alperall commited on
Commit
c7eafd5
·
verified ·
1 Parent(s): cb63d54

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -10
app.py CHANGED
@@ -1,22 +1,19 @@
1
  import gradio as gr
2
  import requests
3
 
4
- # Prompt'u çek
5
  prompt_url = "https://raw.githubusercontent.com/ALPERALL/AlpDroid/refs/heads/main/prompt.txt"
6
  system_prompt = requests.get(prompt_url).text.strip()
7
 
8
  # Modeli yükle
9
  model = gr.load(
10
- "models/baidu/ERNIE-4.5-21B-A3B-PT",
11
- provider="novita"
12
  )
13
 
14
- # Modelin yüklendiğini basitçe test et (opsiyonel)
15
- print(model("Merhaba!")) # Eğer bu satır hata verirse, model yüklenememiş demektir.
16
-
17
- # Chat fonksiyonu
18
  def chat(user_input):
19
- full_prompt = f"{system_prompt}\n\nUser: {user_input}"
20
- return model(full_prompt)
21
 
22
- # Arayüz yok, sadece fonksiyon ve model var
 
 
1
  import gradio as gr
2
  import requests
3
 
4
+ # Prompt'u linkten çek
5
  prompt_url = "https://raw.githubusercontent.com/ALPERALL/AlpDroid/refs/heads/main/prompt.txt"
6
  system_prompt = requests.get(prompt_url).text.strip()
7
 
8
  # Modeli yükle
9
  model = gr.load(
10
+ "models/baidu/ERNIE-4.5-21B-A3B-PT",
11
+ provider="novita"
12
  )
13
 
14
+ # Prompt + Kullanıcı girdisini birleştir
 
 
 
15
  def chat(user_input):
16
+ return model(f"{system_prompt}\n\nUser: {user_input}")
 
17
 
18
+ # Basit arayüz (buton yok, sadece input-output)
19
+ gr.Interface(fn=chat, inputs="text", outputs="text").launch()