Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ from langchain_community.chat_models.gigachat import GigaChat
|
|
| 6 |
from langchain_community.vectorstores import FAISS
|
| 7 |
from langchain_community.embeddings import HuggingFaceEmbeddings
|
| 8 |
import os
|
| 9 |
-
import telebot
|
| 10 |
|
| 11 |
|
| 12 |
def get_yt_links(contexts):
|
|
@@ -30,14 +30,14 @@ def resp2msg(resp):
|
|
| 30 |
|
| 31 |
def process_input(text):
|
| 32 |
response = retrieval_chain.invoke({"input": text})
|
| 33 |
-
bot.send_message(user_id, resp2msg(response))
|
| 34 |
youtube_links = get_yt_links(response['context'])
|
| 35 |
return response['answer'], youtube_links[0], youtube_links[1], youtube_links[2]
|
| 36 |
|
| 37 |
giga = os.getenv('GIGA')
|
| 38 |
-
token = os.getenv('BOT')
|
| 39 |
-
user_id = os.getenv('CREATOR')
|
| 40 |
-
bot = telebot.TeleBot(token)
|
| 41 |
model_name = "sentence-transformers/paraphrase-multilingual-mpnet-base-v2"
|
| 42 |
model_kwargs = {'device': 'cpu'}
|
| 43 |
encode_kwargs = {'normalize_embeddings': False}
|
|
|
|
| 6 |
from langchain_community.vectorstores import FAISS
|
| 7 |
from langchain_community.embeddings import HuggingFaceEmbeddings
|
| 8 |
import os
|
| 9 |
+
#import telebot
|
| 10 |
|
| 11 |
|
| 12 |
def get_yt_links(contexts):
|
|
|
|
| 30 |
|
| 31 |
def process_input(text):
|
| 32 |
response = retrieval_chain.invoke({"input": text})
|
| 33 |
+
#bot.send_message(user_id, resp2msg(response))
|
| 34 |
youtube_links = get_yt_links(response['context'])
|
| 35 |
return response['answer'], youtube_links[0], youtube_links[1], youtube_links[2]
|
| 36 |
|
| 37 |
giga = os.getenv('GIGA')
|
| 38 |
+
#token = os.getenv('BOT')
|
| 39 |
+
#user_id = os.getenv('CREATOR')
|
| 40 |
+
#bot = telebot.TeleBot(token)
|
| 41 |
model_name = "sentence-transformers/paraphrase-multilingual-mpnet-base-v2"
|
| 42 |
model_kwargs = {'device': 'cpu'}
|
| 43 |
encode_kwargs = {'normalize_embeddings': False}
|