Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -61,22 +61,21 @@ def call_chatgpt(prompt: str) -> str:
|
|
61 |
|
62 |
def ai_judge(sentence1: str, sentence2: str) -> float:
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
|
|
|
|
68 |
def helper(payload):
|
69 |
response = requests.post(API_URL, headers=headers, json=payload)
|
70 |
return response.json()
|
71 |
|
72 |
-
data = helper(
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
}
|
78 |
-
}
|
79 |
-
)
|
80 |
|
81 |
return data
|
82 |
|
|
|
61 |
|
62 |
def ai_judge(sentence1: str, sentence2: str) -> float:
|
63 |
|
64 |
+
API_URL = "https://laazu6ral9w37pfb.us-east-1.aws.endpoints.huggingface.cloud"
|
65 |
+
headers = {
|
66 |
+
"Accept" : "application/json",
|
67 |
+
"Content-Type": "application/json"
|
68 |
+
}
|
69 |
+
|
70 |
def helper(payload):
|
71 |
response = requests.post(API_URL, headers=headers, json=payload)
|
72 |
return response.json()
|
73 |
|
74 |
+
data = helper({
|
75 |
+
"source_sentence": sentence1,
|
76 |
+
"sentences": [sentence2],
|
77 |
+
"parameters": {}
|
78 |
+
})
|
|
|
|
|
|
|
79 |
|
80 |
return data
|
81 |
|