Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,7 +25,7 @@ def ask_question(question):
|
|
| 25 |
|
| 26 |
def animate_typing(text):
|
| 27 |
for char in text:
|
| 28 |
-
st.write_stream(
|
| 29 |
time.sleep(0.05)
|
| 30 |
|
| 31 |
def main():
|
|
@@ -39,8 +39,7 @@ def main():
|
|
| 39 |
answer_placeholder.write("Thinking...")
|
| 40 |
answer = ask_question(question)
|
| 41 |
answer_placeholder.empty()
|
| 42 |
-
|
| 43 |
-
animate_typing(answer)
|
| 44 |
else:
|
| 45 |
st.write("Please enter a question.")
|
| 46 |
|
|
|
|
| 25 |
|
| 26 |
def animate_typing(text):
|
| 27 |
for char in text:
|
| 28 |
+
st.write_stream("Answer: " + text[:text.index(char)+1])
|
| 29 |
time.sleep(0.05)
|
| 30 |
|
| 31 |
def main():
|
|
|
|
| 39 |
answer_placeholder.write("Thinking...")
|
| 40 |
answer = ask_question(question)
|
| 41 |
answer_placeholder.empty()
|
| 42 |
+
animate_typing(answer)
|
|
|
|
| 43 |
else:
|
| 44 |
st.write("Please enter a question.")
|
| 45 |
|