Spaces:
Sleeping
Sleeping
Update src/generation/generate.py
Browse files
src/generation/generate.py
CHANGED
|
@@ -79,11 +79,13 @@ def build_prompt(query, context):
|
|
| 79 |
import requests
|
| 80 |
import os
|
| 81 |
|
|
|
|
|
|
|
| 82 |
def generate_answer(prompt, model="llama-3.1-8b-instant"):
|
| 83 |
response = requests.post(
|
| 84 |
"https://api.groq.com/openai/v1/chat/completions",
|
| 85 |
headers={
|
| 86 |
-
"Authorization": f"Bearer {os.environ.get('GROQ_API_KEY')}",
|
| 87 |
"Content-Type": "application/json"
|
| 88 |
},
|
| 89 |
json={
|
|
|
|
| 79 |
import requests
|
| 80 |
import os
|
| 81 |
|
| 82 |
+
|
| 83 |
+
|
| 84 |
def generate_answer(prompt, model="llama-3.1-8b-instant"):
|
| 85 |
response = requests.post(
|
| 86 |
"https://api.groq.com/openai/v1/chat/completions",
|
| 87 |
headers={
|
| 88 |
+
"Authorization": f"Bearer {os.environ.get('GROQ_API_KEY','').strip()}",
|
| 89 |
"Content-Type": "application/json"
|
| 90 |
},
|
| 91 |
json={
|