Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -23,16 +23,6 @@ if UseMemory:
|
|
23 |
DATA_FILE=os.path.join("data", DATA_FILENAME)
|
24 |
HF_TOKEN=os.environ.get("HF_TOKEN")
|
25 |
|
26 |
-
#SCRIPT = """
|
27 |
-
#<script>
|
28 |
-
#if (!window.hasBeenRun) {
|
29 |
-
# window.hasBeenRun = true;
|
30 |
-
# console.log("should only happen once");
|
31 |
-
# document.querySelector("button.submit").click();
|
32 |
-
#}
|
33 |
-
#</script>
|
34 |
-
#"""
|
35 |
-
|
36 |
if UseMemory:
|
37 |
try:
|
38 |
hf_hub_download(
|
@@ -57,22 +47,6 @@ def store_message(name: str, message: str):
|
|
57 |
# uncomment line below to begin saving. If creating your own copy you will need to add a access token called "HF_TOKEN" to your profile, then create a secret for your repo with the access code naming it "HF_TOKEN" For the CSV as well you can copy the header and first few lines to your own then update the paths above which should work to save to your own repository for datasets.
|
58 |
commit_url = repo.push_to_hub()
|
59 |
return ""
|
60 |
-
|
61 |
-
#iface = gr.Interface(
|
62 |
-
# store_message,
|
63 |
-
# [
|
64 |
-
# inputs.Textbox(placeholder="Your name"),
|
65 |
-
# inputs.Textbox(placeholder="Your message", lines=2),
|
66 |
-
# ],
|
67 |
-
# "html",
|
68 |
-
# css="""
|
69 |
-
# .message {background-color:cornflowerblue;color:white; padding:4px;margin:4px;border-radius:4px; }
|
70 |
-
# """,
|
71 |
-
# title="Reading/writing to a HuggingFace dataset repo from Spaces",
|
72 |
-
# description=f"This is a demo of how to do simple *shared data persistence* in a Gradio Space, backed by a dataset repo.",
|
73 |
-
# article=f"The dataset repo is [{DATASET_REPO_URL}]({DATASET_REPO_URL})",
|
74 |
-
#)
|
75 |
-
# --------------------------------------------------- For Memory
|
76 |
|
77 |
mname = "facebook/blenderbot-400M-distill"
|
78 |
model = BlenderbotForConditionalGeneration.from_pretrained(mname)
|
@@ -94,10 +68,9 @@ def add_note_to_history(note, note_history):
|
|
94 |
return [note_history]
|
95 |
|
96 |
|
97 |
-
|
98 |
title = "💬ChatBack🧠💾"
|
99 |
description = """Chatbot With persistent memory dataset allowing multiagent system AI to access a shared dataset as memory pool with stored interactions.
|
100 |
-
|
101 |
|
102 |
def chat(message, history):
|
103 |
history = history or []
|
@@ -135,7 +108,7 @@ gr.Interface(
|
|
135 |
|
136 |
|
137 |
description=f"Gradio chatbot backed by memory in a dataset repository.",
|
138 |
-
article=f"The memory dataset for saves is [{DATASET_REPO_URL}]({DATASET_REPO_URL}) 🦃
|
139 |
|
140 |
).launch(debug=True)
|
141 |
|
|
|
23 |
DATA_FILE=os.path.join("data", DATA_FILENAME)
|
24 |
HF_TOKEN=os.environ.get("HF_TOKEN")
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
if UseMemory:
|
27 |
try:
|
28 |
hf_hub_download(
|
|
|
47 |
# uncomment line below to begin saving. If creating your own copy you will need to add a access token called "HF_TOKEN" to your profile, then create a secret for your repo with the access code naming it "HF_TOKEN" For the CSV as well you can copy the header and first few lines to your own then update the paths above which should work to save to your own repository for datasets.
|
48 |
commit_url = repo.push_to_hub()
|
49 |
return ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
mname = "facebook/blenderbot-400M-distill"
|
52 |
model = BlenderbotForConditionalGeneration.from_pretrained(mname)
|
|
|
68 |
return [note_history]
|
69 |
|
70 |
|
|
|
71 |
title = "💬ChatBack🧠💾"
|
72 |
description = """Chatbot With persistent memory dataset allowing multiagent system AI to access a shared dataset as memory pool with stored interactions.
|
73 |
+
Current Best SOTA Chatbot: https://huggingface.co/facebook/blenderbot-400M-distill?text=Hey+my+name+is+ChatBack%21+Are+you+ready+to+rock%3F """
|
74 |
|
75 |
def chat(message, history):
|
76 |
history = history or []
|
|
|
108 |
|
109 |
|
110 |
description=f"Gradio chatbot backed by memory in a dataset repository.",
|
111 |
+
article=f"The memory dataset for saves is [{DATASET_REPO_URL}]({DATASET_REPO_URL}) 🦃Thanks!🦃 Check out HF Datasets: https://huggingface.co/spaces/awacke1/FreddysDatasetViewer SOTA papers code and datasets on chat are here: https://paperswithcode.com/datasets?q=chat&v=lst&o=newest"
|
112 |
|
113 |
).launch(debug=True)
|
114 |
|