Teotonix commited on
Commit
e9a2dab
·
verified ·
1 Parent(s): 27373f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -9,7 +9,8 @@ client = OpenAI(
9
  api_key=HF_TOKEN,
10
  )
11
 
12
- MODEL_ID = "HuggingFaceTB/SmolLM3-3B:hf-inference"
 
13
 
14
  SYSTEM = "Sen MAIND AI'sin. Kısa, net ve yardımcı cevap ver."
15
 
@@ -21,7 +22,7 @@ def llm_reply(user_text: str) -> str:
21
  {"role": "user", "content": user_text},
22
  ],
23
  temperature=0.7,
24
- max_tokens=350,
25
  )
26
  return resp.choices[0].message.content or ""
27
 
@@ -39,9 +40,14 @@ def chat_fn(message, history):
39
  return history
40
 
41
  with gr.Blocks(title="MaindAI") as demo:
42
- gr.Markdown("## MaindAI 🤖")
 
 
 
 
43
  chatbot = gr.Chatbot(value=[])
44
- msg = gr.Textbox(placeholder="Sor...")
 
45
  msg.submit(chat_fn, [msg, chatbot], chatbot)
46
 
47
  demo.launch()
 
9
  api_key=HF_TOKEN,
10
  )
11
 
12
+ # Ücretsiz/hafif model (hf-inference)
13
+ MODEL_ID = "TinyLlama/TinyLlama-1.1B-Chat-v1.0:hf-inference"
14
 
15
  SYSTEM = "Sen MAIND AI'sin. Kısa, net ve yardımcı cevap ver."
16
 
 
22
  {"role": "user", "content": user_text},
23
  ],
24
  temperature=0.7,
25
+ max_tokens=256,
26
  )
27
  return resp.choices[0].message.content or ""
28
 
 
40
  return history
41
 
42
  with gr.Blocks(title="MaindAI") as demo:
43
+ # LOGO (dosya adı repo kökünde: logo.png)
44
+ gr.Image("logo.png", show_label=False, height=120)
45
+
46
+ gr.Markdown("## 💙 MaindAI — Chat")
47
+
48
  chatbot = gr.Chatbot(value=[])
49
+ msg = gr.Textbox(placeholder="Sor...", show_label=False)
50
+
51
  msg.submit(chat_fn, [msg, chatbot], chatbot)
52
 
53
  demo.launch()