Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -45,10 +45,10 @@ def server_one():
|
|
45 |
|
46 |
@app.route('/findsimilarity')
|
47 |
def server_1():
|
48 |
-
payload = { "inputs": { "source_sentence": "That is a happy person", "sentences": [ "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] }, }
|
49 |
-
|
50 |
time.sleep(3)
|
51 |
-
|
52 |
|
53 |
# response = os.system(" curl https://api-inference.huggingface.co/models/sentence-transformers/all-MiniLM-L6-v2 -X POST -d '{ "inputs": { "source_sentence": "That is a happy person", "sentences": [ "That is a happy dog", "That is a very happy person", "Today is a sunny day" , ] } , } ' -H 'Content-Type: application/json' -H 'Authorization: `+bearer+`' " )
|
54 |
|
|
|
45 |
|
46 |
@app.route('/findsimilarity')
|
47 |
def server_1():
|
48 |
+
payload = { "inputs": { "source_sentence": "That is a happy person", "sentences": [ "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] } , }
|
49 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
50 |
time.sleep(3)
|
51 |
+
return response.json()
|
52 |
|
53 |
# response = os.system(" curl https://api-inference.huggingface.co/models/sentence-transformers/all-MiniLM-L6-v2 -X POST -d '{ "inputs": { "source_sentence": "That is a happy person", "sentences": [ "That is a happy dog", "That is a very happy person", "Today is a sunny day" , ] } , } ' -H 'Content-Type: application/json' -H 'Authorization: `+bearer+`' " )
|
54 |
|