Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,12 +7,12 @@ from langchain.prompts import PromptTemplate
|
|
| 7 |
import gradio as gr
|
| 8 |
|
| 9 |
# Set up the ChatGroq API
|
| 10 |
-
|
| 11 |
if not api_key:
|
| 12 |
raise ValueError("Please set the GROQ_API_KEY environment variable")
|
| 13 |
|
| 14 |
# Initialize the ChatGroq LLM
|
| 15 |
-
llm = ChatGroq(temperature=0, model_name='llama-3.1-8b-instant', groq_api_key=
|
| 16 |
|
| 17 |
# Define a prompt template for entity extraction
|
| 18 |
entity_extraction_prompt = PromptTemplate(
|
|
|
|
| 7 |
import gradio as gr
|
| 8 |
|
| 9 |
# Set up the ChatGroq API
|
| 10 |
+
GROQ_API_KEY = os.environ.get("GROQ_API_KEY")
|
| 11 |
if not api_key:
|
| 12 |
raise ValueError("Please set the GROQ_API_KEY environment variable")
|
| 13 |
|
| 14 |
# Initialize the ChatGroq LLM
|
| 15 |
+
llm = ChatGroq(temperature=0, model_name='llama-3.1-8b-instant', groq_api_key=GROQ_API_KEY)
|
| 16 |
|
| 17 |
# Define a prompt template for entity extraction
|
| 18 |
entity_extraction_prompt = PromptTemplate(
|