Spaces:
Paused
Paused
Commit
路
2a8ca12
1
Parent(s):
4f8ab06
hugginngface no acepta write_stream
Browse files
app.py
CHANGED
@@ -5,9 +5,7 @@ import numpy as np
|
|
5 |
import pandas as pd
|
6 |
import streamlit as st
|
7 |
|
8 |
-
|
9 |
-
for _ in model(prompt,_stream):
|
10 |
-
yield str(_)
|
11 |
|
12 |
if "model" not in st.session_state:
|
13 |
st.session_state["model"] = "TheBloke/Mistral-7B-OpenOrca-GGUF"
|
@@ -30,18 +28,8 @@ if prompt := st.chat_input("Preg煤ntale a Don Sim贸n"):
|
|
30 |
st.markdown(prompt)
|
31 |
|
32 |
with st.chat_message("assistant"):
|
33 |
-
stream = model(
|
34 |
-
response = st.
|
35 |
-
|
36 |
-
|
37 |
|
38 |
-
'''
|
39 |
-
text= st.text_area("Preg煤ntale a Don Sim贸n")
|
40 |
|
41 |
-
if text:
|
42 |
-
#answer = similarity_search(text,5)
|
43 |
-
answer=""
|
44 |
-
for _ in model(text,max_new_tokens=25, stream=True):
|
45 |
-
answer= answer+str(_)
|
46 |
-
print(answer)'''
|
47 |
-
|
|
|
5 |
import pandas as pd
|
6 |
import streamlit as st
|
7 |
|
8 |
+
|
|
|
|
|
9 |
|
10 |
if "model" not in st.session_state:
|
11 |
st.session_state["model"] = "TheBloke/Mistral-7B-OpenOrca-GGUF"
|
|
|
28 |
st.markdown(prompt)
|
29 |
|
30 |
with st.chat_message("assistant"):
|
31 |
+
stream = model(prompt,max_new_tokens=10)
|
32 |
+
response = st.write(stream)
|
33 |
+
st.session_state.messages.append({"role": "assistant", "content": response})
|
|
|
34 |
|
|
|
|
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|