Spaces:
Runtime error
Runtime error
gabriel lopez
commited on
Commit
·
0e1a80a
1
Parent(s):
38fdc49
reqs
Browse files- app.py +0 -4
- requirements.txt +3 -0
app.py
CHANGED
|
@@ -29,8 +29,6 @@ def chat_with_bot(user_input, chat_history_and_input=[]):
|
|
| 29 |
emb_user_input = tokenizer.encode(
|
| 30 |
user_input + tokenizer.eos_token, return_tensors="tf"
|
| 31 |
)
|
| 32 |
-
print("chat_history:", chat_history_and_input)
|
| 33 |
-
print("emb_user_input:", emb_user_input)
|
| 34 |
if chat_history_and_input == []:
|
| 35 |
bot_input_ids = emb_user_input # first iteration
|
| 36 |
else:
|
|
@@ -45,8 +43,6 @@ def chat_with_bot(user_input, chat_history_and_input=[]):
|
|
| 45 |
chat_history_and_input[:, bot_input_ids.shape[-1] :][0],
|
| 46 |
skip_special_tokens=True,
|
| 47 |
)
|
| 48 |
-
print(f"{bot_response=}")
|
| 49 |
-
print(f"{chat_history_and_input=}")
|
| 50 |
return bot_response, chat_history_and_input
|
| 51 |
|
| 52 |
gr.Interface(
|
|
|
|
| 29 |
emb_user_input = tokenizer.encode(
|
| 30 |
user_input + tokenizer.eos_token, return_tensors="tf"
|
| 31 |
)
|
|
|
|
|
|
|
| 32 |
if chat_history_and_input == []:
|
| 33 |
bot_input_ids = emb_user_input # first iteration
|
| 34 |
else:
|
|
|
|
| 43 |
chat_history_and_input[:, bot_input_ids.shape[-1] :][0],
|
| 44 |
skip_special_tokens=True,
|
| 45 |
)
|
|
|
|
|
|
|
| 46 |
return bot_response, chat_history_and_input
|
| 47 |
|
| 48 |
gr.Interface(
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio==3.10.1
|
| 2 |
+
tensorflow==2.4.1
|
| 3 |
+
transformers==4.24.0
|