Spaces:
Paused
Paused
Franc v1.0
Browse files
app.py
CHANGED
@@ -104,41 +104,25 @@ rag_chain = RetrievalQA.from_chain_type(
|
|
104 |
)
|
105 |
|
106 |
|
|
|
|
|
|
|
|
|
107 |
def generate(message, history):
|
108 |
reply = rag_chain(message)
|
109 |
|
110 |
return reply['result'].strip()
|
111 |
|
112 |
|
113 |
-
gr.ChatInterface(
|
114 |
generate,
|
115 |
title="Franc v0.9",
|
116 |
-
examples=[
|
117 |
-
"How does marathon fueling affect running economy?",
|
118 |
-
"What is the difference between a stride and a step?",
|
119 |
-
"What are the symptoms of Achilles tendinosis?",
|
120 |
-
"What causes VO2max to decrease past age 40?",
|
121 |
-
"What factors contribute to optimal stride length?",
|
122 |
-
"Why doesn't heart rate limit VO2max?",
|
123 |
-
"What are some benefits of running on soft surfaces?",
|
124 |
-
"What are the main theories on the mechanism causing hamstring tears?",
|
125 |
-
"What causes DOMS?",
|
126 |
-
"How can runners avoid burnout?",
|
127 |
-
"Who was the first man to run a sub-4-minute mile?",
|
128 |
-
"What's VO2max?",
|
129 |
-
"How can you prevent side stitches?",
|
130 |
-
"How much did Peter Snell train in his peak years?",
|
131 |
-
"What's ITBS?",
|
132 |
-
"What is periodization?",
|
133 |
-
"What does creatine supplementation do?",
|
134 |
-
"What are some keys to an effective pre-race taper?",
|
135 |
-
"Can overtraining be reversed?",
|
136 |
-
"How do hill workouts benefit runners?",
|
137 |
-
"What are three effects of fasting before exercise?"
|
138 |
-
],
|
139 |
-
cache_examples=True,
|
140 |
theme=gr.themes.Soft(),
|
141 |
submit_btn="Ask Franc",
|
142 |
retry_btn="Do better, Franc!",
|
143 |
autofocus=True,
|
144 |
-
)
|
|
|
|
|
|
|
|
|
|
104 |
)
|
105 |
|
106 |
|
107 |
+
def clear_memory():
|
108 |
+
memory.clear()
|
109 |
+
|
110 |
+
|
111 |
def generate(message, history):
|
112 |
reply = rag_chain(message)
|
113 |
|
114 |
return reply['result'].strip()
|
115 |
|
116 |
|
117 |
+
chat_interface = gr.ChatInterface(
|
118 |
generate,
|
119 |
title="Franc v0.9",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
theme=gr.themes.Soft(),
|
121 |
submit_btn="Ask Franc",
|
122 |
retry_btn="Do better, Franc!",
|
123 |
autofocus=True,
|
124 |
+
)
|
125 |
+
|
126 |
+
chat_interface.clear_btn.click(fn=clear_memory)
|
127 |
+
|
128 |
+
chat_interface.queue().launch()
|