Onurcan Genç commited on
Commit ·
b248a5f
1
Parent(s): 2a7ad12
api token
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ load_dotenv() # Load environment variables from .env
|
|
| 8 |
def generate_text(prompt):
|
| 9 |
# Use the correct model URL for EleutherAI's GPT-J 6B
|
| 10 |
url = "https://api-inference.huggingface.co/models/EleutherAI/gpt-j-6b"
|
| 11 |
-
headers = {"Authorization": f"Bearer {os.getenv('
|
| 12 |
|
| 13 |
# Send the request with the prompt as input
|
| 14 |
response = requests.post(url, headers=headers, json={"inputs": prompt})
|
|
|
|
| 8 |
def generate_text(prompt):
|
| 9 |
# Use the correct model URL for EleutherAI's GPT-J 6B
|
| 10 |
url = "https://api-inference.huggingface.co/models/EleutherAI/gpt-j-6b"
|
| 11 |
+
headers = {"Authorization": f"Bearer {os.getenv('HUGGINGFACE_API_KEY')}"}
|
| 12 |
|
| 13 |
# Send the request with the prompt as input
|
| 14 |
response = requests.post(url, headers=headers, json={"inputs": prompt})
|