Spaces:
Sleeping
Sleeping
ddovidovich
commited on
Commit
·
94899d7
1
Parent(s):
2dff3d5
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ import numpy as np
|
|
6 |
from tqdm.auto import tqdm
|
7 |
from sentence_transformers import SentenceTransformer
|
8 |
import torch
|
|
|
9 |
import llama_cpp
|
10 |
from llama_cpp import Llama
|
11 |
from huggingface_hub import hf_hub_download
|
@@ -75,10 +76,15 @@ def main():
|
|
75 |
st.write("Most relevants answers")
|
76 |
st.table(dataList)
|
77 |
|
78 |
-
#
|
79 |
-
st.
|
80 |
-
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
# Запуск основной части приложения
|
84 |
if __name__ == "__main__":
|
|
|
6 |
from tqdm.auto import tqdm
|
7 |
from sentence_transformers import SentenceTransformer
|
8 |
import torch
|
9 |
+
import copy
|
10 |
import llama_cpp
|
11 |
from llama_cpp import Llama
|
12 |
from huggingface_hub import hf_hub_download
|
|
|
76 |
st.write("Most relevants answers")
|
77 |
st.table(dataList)
|
78 |
|
79 |
+
# Кнопка "Answer LLM"
|
80 |
+
if st.button("LLM Answer"):
|
81 |
+
st.write("LLAMA generated answer:")
|
82 |
+
output = llm('Что ты можешь рассказать про поэта Пушкина?', max_tokens=512, stream=True)
|
83 |
+
for out in output:
|
84 |
+
stream = copy.deepcopy(out)
|
85 |
+
text_output = st.text_area("", stream["choices"][0]["text"])
|
86 |
+
pass
|
87 |
+
|
88 |
|
89 |
# Запуск основной части приложения
|
90 |
if __name__ == "__main__":
|