Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,11 @@ df = pd.read_csv('combined_questions_and_answers.csv')
|
|
16 |
question_embeddings = model.encode(df['Question'].tolist())
|
17 |
|
18 |
# Hugging Face API details for Meta-Llama 3B
|
19 |
-
|
|
|
|
|
|
|
|
|
20 |
|
21 |
# Function to refine and translate text using Meta-Llama 3B
|
22 |
def refine_text(prompt):
|
|
|
16 |
question_embeddings = model.encode(df['Question'].tolist())
|
17 |
|
18 |
# Hugging Face API details for Meta-Llama 3B
|
19 |
+
api_key = os.getenv("HUGGINGFACE_API_KEY")
|
20 |
+
if not api_key:
|
21 |
+
raise ValueError("Hugging Face API key not found in environment variables. Please set the HUGGINGFACE_API_KEY environment variable.")
|
22 |
+
|
23 |
+
pipe = pipeline("text-generation", model="meta-llama/Meta-Llama-3-8B-Instruct", token=api_key)
|
24 |
|
25 |
# Function to refine and translate text using Meta-Llama 3B
|
26 |
def refine_text(prompt):
|