Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 11 |
-
|
| 12 |
)
|
| 13 |
|
| 14 |
-
#
|
| 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 |
-
|
| 20 |
-
return model(full_prompt)
|
| 21 |
|
| 22 |
-
#
|
|
|
|
|
|
| 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()
|