Bofandra commited on
Commit
64198ae
·
verified ·
1 Parent(s): c391599

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,12 +8,14 @@ import httpcore
8
  import pickle
9
  import time
10
  setattr(httpcore, 'SyncHTTPTransport', 'AsyncHTTPProxy')
 
11
 
12
  """
13
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
14
  """
15
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
16
  model = SentenceTransformer('intfloat/multilingual-e5-large-instruct')
 
17
 
18
  def get_detailed_instruct(task_description: str, query: str) -> str:
19
  return f'Instruct: {task_description}\nQuery: {query}'
@@ -54,8 +56,6 @@ def respond(
54
  print("sorted references\n")
55
  print(time.time())
56
 
57
- from googletrans import Translator
58
- translator = Translator()
59
 
60
  for index, row in sorted_references.iterrows():
61
  if(type(row["user"]) is str and type(row['assistant']) is str):
 
8
  import pickle
9
  import time
10
  setattr(httpcore, 'SyncHTTPTransport', 'AsyncHTTPProxy')
11
+ from googletrans import Translator
12
 
13
  """
14
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
15
  """
16
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
17
  model = SentenceTransformer('intfloat/multilingual-e5-large-instruct')
18
+ translator = Translator()
19
 
20
  def get_detailed_instruct(task_description: str, query: str) -> str:
21
  return f'Instruct: {task_description}\nQuery: {query}'
 
56
  print("sorted references\n")
57
  print(time.time())
58
 
 
 
59
 
60
  for index, row in sorted_references.iterrows():
61
  if(type(row["user"]) is str and type(row['assistant']) is str):