Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
import requests
|
|
|
3 |
|
4 |
API_URL = "https://api-inference.huggingface.co/models/mistralai/Mixtral-8x7B-Instruct-v0.1"
|
5 |
-
|
6 |
-
|
7 |
headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
8 |
|
9 |
def generate_suggestion(mots):
|
@@ -37,9 +38,10 @@ Termine toujours par •°○
|
|
37 |
|
38 |
iface = gr.Interface(
|
39 |
fn=generate_suggestion,
|
40 |
-
inputs=gr.Textbox(label="
|
41 |
outputs="text",
|
42 |
-
title="Résonance Hypnopoétique •°○"
|
|
|
43 |
)
|
44 |
|
45 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
import requests
|
3 |
+
import os
|
4 |
|
5 |
API_URL = "https://api-inference.huggingface.co/models/mistralai/Mixtral-8x7B-Instruct-v0.1"
|
6 |
+
HF_TOKEN = os.environ["HF_TOKEN"] # sécurisé via secret
|
7 |
+
|
8 |
headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
9 |
|
10 |
def generate_suggestion(mots):
|
|
|
38 |
|
39 |
iface = gr.Interface(
|
40 |
fn=generate_suggestion,
|
41 |
+
inputs=gr.Textbox(label="Mots sensoriels (séparés par virgule)", lines=2, placeholder="souffle, lumière, peau..."),
|
42 |
outputs="text",
|
43 |
+
title="Résonance Hypnopoétique •°○",
|
44 |
+
description="Génère une suggestion poétique et sensorielle en 5 phrases, inspirée de vos mots-clés."
|
45 |
)
|
46 |
|
47 |
iface.launch()
|