Spaces:
Runtime error
Runtime error
Commit
•
d8535e1
1
Parent(s):
d0806a8
Update app.py
Browse files
app.py
CHANGED
@@ -39,6 +39,11 @@ def clean_chat_output(txt, prompt, interlocutor_names):
|
|
39 |
output = output[:output.find(delimiter)]
|
40 |
return output
|
41 |
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
def chat(message, npc_name, initial_prompt, top_p, temperature, max_new_tokens, history=[]):
|
44 |
interlocutor_names = ["Player", npc_name]
|
|
|
39 |
output = output[:output.find(delimiter)]
|
40 |
return output
|
41 |
|
42 |
+
# GPT-J-6B API
|
43 |
+
API_URL = "https://api-inference.huggingface.co/models/EleutherAI/gpt-j-6B"
|
44 |
+
def query(payload):
|
45 |
+
response = requests.post(API_URL, json=payload)
|
46 |
+
return response.json()
|
47 |
|
48 |
def chat(message, npc_name, initial_prompt, top_p, temperature, max_new_tokens, history=[]):
|
49 |
interlocutor_names = ["Player", npc_name]
|