Spaces:
Runtime error
Runtime error
Henry Qu
commited on
Commit
·
b7be715
1
Parent(s):
5cf8e31
modified: app.py
Browse files
app.py
CHANGED
|
@@ -13,13 +13,12 @@ logits_dict = {}
|
|
| 13 |
json_file = 'index.json'
|
| 14 |
with open(json_file, 'r') as file:
|
| 15 |
data = json.load(file)
|
| 16 |
-
for
|
| 17 |
-
|
| 18 |
-
text_description = item['text_description']
|
| 19 |
inputs = tokenizer(text_description, return_tensors="pt", padding=True, truncation=True)
|
| 20 |
outputs = model(**inputs, labels=inputs["input_ids"])
|
| 21 |
logits = outputs.logits
|
| 22 |
-
logits_dict[
|
| 23 |
|
| 24 |
|
| 25 |
def search_index(query):
|
|
|
|
| 13 |
json_file = 'index.json'
|
| 14 |
with open(json_file, 'r') as file:
|
| 15 |
data = json.load(file)
|
| 16 |
+
for key, value in data.items():
|
| 17 |
+
text_description = value['text_description']
|
|
|
|
| 18 |
inputs = tokenizer(text_description, return_tensors="pt", padding=True, truncation=True)
|
| 19 |
outputs = model(**inputs, labels=inputs["input_ids"])
|
| 20 |
logits = outputs.logits
|
| 21 |
+
logits_dict[key] = logits
|
| 22 |
|
| 23 |
|
| 24 |
def search_index(query):
|