Spaces:
Runtime error
Runtime error
Logan Zoellner
commited on
Commit
·
a72960c
1
Parent(s):
79ece5e
apparently I do need headers?
Browse files
app.py
CHANGED
@@ -4,6 +4,8 @@ import os
|
|
4 |
|
5 |
# GPT-J-6B API
|
6 |
API_URL = "https://api-inference.huggingface.co/models/EleutherAI/gpt-j-6B"
|
|
|
|
|
7 |
|
8 |
prompt = """
|
9 |
Bilbo is a hobbit rogue who wears a brown cloak and carries a ring.
|
@@ -26,7 +28,8 @@ def npc_generate(name,race,characterClass):
|
|
26 |
"max_new_tokens": 50,
|
27 |
"return_full_text": False
|
28 |
}}
|
29 |
-
response = requests.post(API_URL, headers=headers, json=json_)
|
|
|
30 |
output = response.json()
|
31 |
print(f"If there was an error? Reason is : {output}")
|
32 |
output_tmp = output[0]['generated_text']
|
|
|
4 |
|
5 |
# GPT-J-6B API
|
6 |
API_URL = "https://api-inference.huggingface.co/models/EleutherAI/gpt-j-6B"
|
7 |
+
#HF_TOKEN = os.environ["HF_TOKEN"]
|
8 |
+
#headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
9 |
|
10 |
prompt = """
|
11 |
Bilbo is a hobbit rogue who wears a brown cloak and carries a ring.
|
|
|
28 |
"max_new_tokens": 50,
|
29 |
"return_full_text": False
|
30 |
}}
|
31 |
+
#response = requests.post(API_URL, headers=headers, json=json_)
|
32 |
+
response = requests.post(API_URL, json=json_)
|
33 |
output = response.json()
|
34 |
print(f"If there was an error? Reason is : {output}")
|
35 |
output_tmp = output[0]['generated_text']
|