datacipen commited on
Commit
ab27551
1 Parent(s): b4632c5

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +10 -10
main.py CHANGED
@@ -27,7 +27,7 @@ from deep_translator import GoogleTranslator
27
  from datetime import timedelta
28
 
29
  @cl.step(type="tool")
30
- async def LLModel():
31
  os.environ['HUGGINGFACEHUB_API_TOKEN'] = os.environ['HUGGINGFACEHUB_API_TOKEN']
32
  repo_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
33
  llm = HuggingFaceEndpoint(
@@ -122,7 +122,7 @@ async def set_starters():
122
  @cl.on_message
123
  async def on_message(message: cl.Message):
124
  await cl.Message(f"> EVENTIA").send()
125
- model = await LLModel()
126
  retriever = await Retriever("videosTC")
127
  ########## Chain with streaming ##########
128
  message_history = ChatMessageHistory()
@@ -177,14 +177,14 @@ async def on_message(message: cl.Message):
177
  content="Vidéos : ",
178
  elements=sources,
179
  ).send()
180
- if search[2]:
181
- sourcesOffres = [
182
- cl.Text(name="Sources audio", content=search[2], display="inline")
183
- ]
184
- await cl.Message(
185
- content="Audio : ",
186
- elements=sourcesOffres,
187
- ).send()
188
  verbatim = [
189
  cl.Text(name="Verbatim", content=search[1], display="side")
190
  ]
 
27
  from datetime import timedelta
28
 
29
  @cl.step(type="tool")
30
+ async def LLMistral():
31
  os.environ['HUGGINGFACEHUB_API_TOKEN'] = os.environ['HUGGINGFACEHUB_API_TOKEN']
32
  repo_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
33
  llm = HuggingFaceEndpoint(
 
122
  @cl.on_message
123
  async def on_message(message: cl.Message):
124
  await cl.Message(f"> EVENTIA").send()
125
+ model = await LLMistral()
126
  retriever = await Retriever("videosTC")
127
  ########## Chain with streaming ##########
128
  message_history = ChatMessageHistory()
 
177
  content="Vidéos : ",
178
  elements=sources,
179
  ).send()
180
+ #if search[2]:
181
+ # sourcesOffres = [
182
+ # cl.Text(name="Sources audio", content=search[2], display="inline")
183
+ # ]
184
+ # await cl.Message(
185
+ # content="Audio : ",
186
+ # elements=sourcesOffres,
187
+ # ).send()
188
  verbatim = [
189
  cl.Text(name="Verbatim", content=search[1], display="side")
190
  ]