Delete client.py
Browse files
client.py
DELETED
|
@@ -1,21 +0,0 @@
|
|
| 1 |
-
import requests
|
| 2 |
-
|
| 3 |
-
# Substitua pelo seu URL do ngrok ou Space
|
| 4 |
-
url = "eeda-34-124-254-92.ngrok-free.app/generate" # Certifique-se de usar o endpoint correto
|
| 5 |
-
|
| 6 |
-
def infer_simple(prompt):
|
| 7 |
-
# Envia uma requisição POST para o endpoint do servidor
|
| 8 |
-
response = requests.post(url, json={"prompt": prompt})
|
| 9 |
-
|
| 10 |
-
# Verifica se a requisição foi bem-sucedida
|
| 11 |
-
if response.status_code == 200:
|
| 12 |
-
return response.json()["result"]
|
| 13 |
-
else:
|
| 14 |
-
print(f"Erro: {response.status_code} - {response.text}")
|
| 15 |
-
return None
|
| 16 |
-
|
| 17 |
-
# Testando a função
|
| 18 |
-
if __name__ == "__main__":
|
| 19 |
-
prompt = "A beautiful brunette woman wearing a blue leather pants"
|
| 20 |
-
result = infer_simple(prompt)
|
| 21 |
-
print(f"Resultado: {result}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|