Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,7 @@ event = Event()
|
|
| 20 |
DISCORD_TOKEN = os.getenv("DISCORD_TOKEN")
|
| 21 |
|
| 22 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 23 |
-
|
| 24 |
|
| 25 |
|
| 26 |
|
|
@@ -112,7 +112,7 @@ def codellama_initial_generation(prompt, thread):
|
|
| 112 |
with open(chat_history, "w") as json_file:
|
| 113 |
json.dump(conversation, json_file)
|
| 114 |
|
| 115 |
-
job =
|
| 116 |
|
| 117 |
while job.done() is False:
|
| 118 |
pass
|
|
@@ -173,7 +173,7 @@ async def continue_codellama(message):
|
|
| 173 |
total_characters += len(string)
|
| 174 |
|
| 175 |
if total_characters < 15000:
|
| 176 |
-
job =
|
| 177 |
while job.done() is False:
|
| 178 |
pass
|
| 179 |
else:
|
|
|
|
| 20 |
DISCORD_TOKEN = os.getenv("DISCORD_TOKEN")
|
| 21 |
|
| 22 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 23 |
+
codellama_client = Client("https://huggingface-projects-codellama-13b-chat.hf.space/", HF_TOKEN)
|
| 24 |
|
| 25 |
|
| 26 |
|
|
|
|
| 112 |
with open(chat_history, "w") as json_file:
|
| 113 |
json.dump(conversation, json_file)
|
| 114 |
|
| 115 |
+
job = codellama_client.submit(prompt, chat_history, fn_index=0)
|
| 116 |
|
| 117 |
while job.done() is False:
|
| 118 |
pass
|
|
|
|
| 173 |
total_characters += len(string)
|
| 174 |
|
| 175 |
if total_characters < 15000:
|
| 176 |
+
job = codellama_client.submit(prompt, chat_history, fn_index=0)
|
| 177 |
while job.done() is False:
|
| 178 |
pass
|
| 179 |
else:
|