Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
from gradio import ChatMessage
|
3 |
-
from huggingface_hub import HfApi
|
4 |
import re
|
5 |
import sys
|
6 |
import time
|
@@ -101,13 +100,6 @@ def game_loop(message, history):
|
|
101 |
# Dump the whole gamelog to a json file after this turn
|
102 |
with open(os.path.join(PATH_GAMELOGS,log_filename), 'w', encoding='utf-8') as f:
|
103 |
json.dump(game_log_dictionary, f, ensure_ascii=False, indent=4)
|
104 |
-
|
105 |
-
if world.check_objective():
|
106 |
-
api = HfApi()
|
107 |
-
api.upload_file(path_or_fileobj=os.path.join(PATH_GAMELOGS,log_filename),
|
108 |
-
path_in_repo=os.path.join(PATH_GAMELOGS,log_filename),
|
109 |
-
repo_id="sgongora27/PAYADOR-experiments",
|
110 |
-
repo_type="space")
|
111 |
|
112 |
return answer.replace("<",r"\<").replace(">", r"\>")
|
113 |
|
|
|
1 |
import gradio as gr
|
2 |
from gradio import ChatMessage
|
|
|
3 |
import re
|
4 |
import sys
|
5 |
import time
|
|
|
100 |
# Dump the whole gamelog to a json file after this turn
|
101 |
with open(os.path.join(PATH_GAMELOGS,log_filename), 'w', encoding='utf-8') as f:
|
102 |
json.dump(game_log_dictionary, f, ensure_ascii=False, indent=4)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
return answer.replace("<",r"\<").replace(">", r"\>")
|
105 |
|