JiHa-Kim / LLMLingua-implementation

I'm trying to get LLMLingua to work.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is this?

I am trying to make LLMLingua compatible with an AI API endpoint. I have no clue what I am doing so if you encounter a problem you will probably have to ask someone else for help.

Quick Start

  1. Install the necessary libraries: If you haven’t already, you’ll need to install the openai and llmlingua libraries. You can do this using pip: pip install openai llmlingua

  2. Set up your environment variable: This code uses an environment variable OPENROUTER_API_KEY to store your OpenAI API key. You can set this in your terminal like so: export OPENROUTER_API_KEY=your_api_key_here Replace your_api_key_here with your actual OpenRouter API key.

  3. Run the script: You can now run the script. If you’ve saved it as a Python file (e.g., script.py), you can run it in your terminal like so: python script.py

  4. Enter your contexts: The script will prompt you to enter your contexts. You can enter any text you want to be processed.

  5. Enter your question: After entering your contexts, the script will prompt you to enter your question. Again, you can enter any text you want.

  6. View the result: The script will print the result of the OpenAI completion.

About

I'm trying to get LLMLingua to work.

License:Apache License 2.0


Languages

Language:Python 100.0%