Spaces:
Runtime error
Runtime error
BotWii
Browse files
app.py
CHANGED
|
@@ -1,23 +1,10 @@
|
|
| 1 |
-
import
|
| 2 |
-
|
| 3 |
|
| 4 |
-
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
model="command-nightly",
|
| 10 |
-
prompt=prompt,
|
| 11 |
-
max_tokens=100,
|
| 12 |
-
temperature=0.7
|
| 13 |
-
)
|
| 14 |
-
return response.generations[0].text.strip()
|
| 15 |
|
| 16 |
-
|
| 17 |
-
gr.Interface(
|
| 18 |
-
fn=botwii_ai,
|
| 19 |
-
inputs=gr.Textbox(lines=3, label="Pose ta question"),
|
| 20 |
-
outputs=gr.Textbox(label="Réponse de l'IA"),
|
| 21 |
-
title="🤖 BotWii - Cohere AI",
|
| 22 |
-
description="Assistant IA rapide basé sur Cohere (gratuit avec clé API)"
|
| 23 |
-
).launch()
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
|
| 4 |
+
pipe = pipeline("text-generation", model="Chain-GPT/Solidity-LLM")
|
| 5 |
|
| 6 |
+
def generate_response(prompt):
|
| 7 |
+
response = pipe(prompt, max_new_tokens=200, do_sample=True, temperature=0.7)
|
| 8 |
+
return response[0]['generated_text']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
gr.Interface(fn=generate_response, inputs="text", outputs="text", title="BotWii - Solidity LLM").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|