Mauriciotuks commited on
Commit
b3fe667
·
verified ·
1 Parent(s): a6a004f

![f02ec539-da9b-4d6a-9855-e7df86fc0ec8.jpeg](https://cdn-uploads.huggingface.co/production/uploads/688dcc38d03635bba0fbc3fb/dYiefmlfniLHXVgYP0v18.jpeg)

Files changed (1) hide show
  1. app.py +7 -20
app.py CHANGED
@@ -1,23 +1,10 @@
1
- import cohere
2
- import gradio as gr
3
 
4
- co = cohere.Client("jJa6kl8tZkKMwiSnm9SFeCswbJaXVpzTHalahobF")
5
 
6
- #Fonction IA Cohere
7
- def botwii_ai(prompt):
8
- response = co.generate(
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
- #Interface Gradio
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()