darkshop commited on
Commit
67e3e61
·
verified ·
1 Parent(s): 569c6f8

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from llama_cpp import Llama
3
+
4
+ # Caminho direto para o modelo na raiz
5
+ model_path = "Llama-3.2-1B-Instruct-Q6_K.gguf"
6
+
7
+ # Inicializa o modelo
8
+ llm = Llama(model_path=model_path)
9
+
10
+ def gerar_texto(prompt):
11
+ output = llm(prompt, max_tokens=200)
12
+ return output['text']
13
+
14
+ # Interface Gradio
15
+ iface = gr.Interface(
16
+ fn=gerar_texto,
17
+ inputs=gr.Textbox(lines=5, placeholder="Digite seu prompt aqui..."),
18
+ outputs="text",
19
+ title="Llama 3.2 1B Instruct GGUF",
20
+ description="Teste do Llama 3.2 1B Instruct quantizado Q6"
21
+ )
22
+
23
+ iface.launch()