post
Browse files
app.py
CHANGED
|
@@ -9,15 +9,15 @@ def greet(name):
|
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
-
url = "
|
| 13 |
-
payload = {"
|
| 14 |
headers = {"Content-Type": "application/json"}
|
| 15 |
|
| 16 |
response = requests.post(url, data=json.dumps(payload), headers=headers)
|
| 17 |
result = response.json()
|
| 18 |
print(result)
|
| 19 |
|
| 20 |
-
return "Hello " + name + "!!"
|
| 21 |
|
| 22 |
iface = gr.Interface(fn=greet, inputs=["text"], outputs="text")
|
| 23 |
iface.launch()
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
+
url = "http://127.0.0.1:5001/samaibackend/us-central1/test"
|
| 13 |
+
payload = {"ima": "cat"}
|
| 14 |
headers = {"Content-Type": "application/json"}
|
| 15 |
|
| 16 |
response = requests.post(url, data=json.dumps(payload), headers=headers)
|
| 17 |
result = response.json()
|
| 18 |
print(result)
|
| 19 |
|
| 20 |
+
return "Hello " + name + "!!" + result
|
| 21 |
|
| 22 |
iface = gr.Interface(fn=greet, inputs=["text"], outputs="text")
|
| 23 |
iface.launch()
|