ThomasFfefefef
commited on
Commit
•
3d25968
1
Parent(s):
867c9b3
Updated app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ import pandas as pd
|
|
8 |
|
9 |
|
10 |
# Template
|
11 |
-
title = "Murder on Horsea Island Prototype 🔪 (WORK IN PROGRESS)"
|
12 |
description = "Prototype of the Unity Game (to test the questions)."
|
13 |
article = """
|
14 |
"""
|
@@ -17,7 +17,7 @@ theme="huggingface"
|
|
17 |
# examples =
|
18 |
|
19 |
# API
|
20 |
-
|
21 |
|
22 |
|
23 |
|
@@ -55,9 +55,9 @@ def build_json(message, questions):
|
|
55 |
return json
|
56 |
|
57 |
|
58 |
-
def query(payload):
|
59 |
-
|
60 |
-
|
61 |
|
62 |
def answer(output_json, character):
|
63 |
# First we handle output_json
|
|
|
8 |
|
9 |
|
10 |
# Template
|
11 |
+
title = "Murder on Horsea Island Prototype with Sentence Similarity (Paraphrase XLM-R multilingual)🔪 (WORK IN PROGRESS)"
|
12 |
description = "Prototype of the Unity Game (to test the questions)."
|
13 |
article = """
|
14 |
"""
|
|
|
17 |
# examples =
|
18 |
|
19 |
# API
|
20 |
+
SS_API_URL = "https://api-inference.huggingface.co/models/sentence-transformers/paraphrase-xlm-r-multilingual-v1"
|
21 |
|
22 |
|
23 |
|
|
|
55 |
return json
|
56 |
|
57 |
|
58 |
+
def query(payload, model):
|
59 |
+
response = requests.post(SS_API_URL, json=payload)
|
60 |
+
return response.json()
|
61 |
|
62 |
def answer(output_json, character):
|
63 |
# First we handle output_json
|