Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,6 @@ title = """# 🙋🏻♂️Welcome to tonic's e5 connector for e5Mistral7b
|
|
| 8 |
|
| 9 |
client = Client("https://tonic-e5.hf.space/--replicas/w3v1e/")
|
| 10 |
|
| 11 |
-
# task list : ['ArguAna', 'ClimateFEVER', 'DBPedia', 'FEVER', 'FiQA2018', 'HotpotQA', 'MSMARCO', 'NFCorpus', 'NQ', 'QuoraRetrieval', 'SCIDOCS', 'SciFact', 'Touche2020', 'TRECCOVID'] in 'Select a Task'
|
| 12 |
def get_embeddings(task, input_text):
|
| 13 |
try:
|
| 14 |
result = client.predict(
|
|
@@ -20,11 +19,8 @@ def get_embeddings(task, input_text):
|
|
| 20 |
except Exception as e:
|
| 21 |
return str(e)
|
| 22 |
|
| 23 |
-
### connector ;-)
|
| 24 |
-
|
| 25 |
def generate_embeddings(input_text, model, encoding_format, user):
|
| 26 |
-
# Here, you might want to use 'model', 'encoding_format', and 'user' in some way
|
| 27 |
-
# Currently, only 'model' is passed to 'get_embeddings'
|
| 28 |
embeddings = get_embeddings(model, input_text)
|
| 29 |
return embeddings
|
| 30 |
|
|
|
|
| 8 |
|
| 9 |
client = Client("https://tonic-e5.hf.space/--replicas/w3v1e/")
|
| 10 |
|
|
|
|
| 11 |
def get_embeddings(task, input_text):
|
| 12 |
try:
|
| 13 |
result = client.predict(
|
|
|
|
| 19 |
except Exception as e:
|
| 20 |
return str(e)
|
| 21 |
|
| 22 |
+
### connector ;-)
|
|
|
|
| 23 |
def generate_embeddings(input_text, model, encoding_format, user):
|
|
|
|
|
|
|
| 24 |
embeddings = get_embeddings(model, input_text)
|
| 25 |
return embeddings
|
| 26 |
|