Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,14 +4,22 @@ from huggingface_hub import InferenceClient
|
|
| 4 |
|
| 5 |
token = os.getenv("SecretToken")
|
| 6 |
|
| 7 |
-
client = InferenceClient(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
def chat_interface(message, history):
|
| 10 |
try:
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
return response
|
| 13 |
except Exception as e:
|
| 14 |
-
return f"Erreur
|
| 15 |
|
| 16 |
demo = gr.ChatInterface(
|
| 17 |
fn=chat_interface,
|
|
|
|
| 4 |
|
| 5 |
token = os.getenv("SecretToken")
|
| 6 |
|
| 7 |
+
client = InferenceClient(
|
| 8 |
+
"ShadowEternity/CTFSolver",
|
| 9 |
+
token=token,
|
| 10 |
+
timeout=120
|
| 11 |
+
)
|
| 12 |
|
| 13 |
def chat_interface(message, history):
|
| 14 |
try:
|
| 15 |
+
response = client.text_generation(
|
| 16 |
+
message,
|
| 17 |
+
max_new_tokens=512,
|
| 18 |
+
stream=False
|
| 19 |
+
)
|
| 20 |
return response
|
| 21 |
except Exception as e:
|
| 22 |
+
return f"Erreur : {str(e)}"
|
| 23 |
|
| 24 |
demo = gr.ChatInterface(
|
| 25 |
fn=chat_interface,
|