Spaces:
Sleeping
Sleeping
Delete app.py
Browse files
app.py
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
from transformers import pipeline
|
3 |
-
|
4 |
-
# Modelni yuklash
|
5 |
-
generator = pipeline("text-generation", model="ai-forever/rugpt3small_based_on_gpt2")
|
6 |
-
|
7 |
-
# Javob funksiyasi
|
8 |
-
def chat_with_model(prompt):
|
9 |
-
res = generator(prompt, max_length=100, do_sample=True, top_p=0.95, top_k=60)
|
10 |
-
return res[0]['generated_text']
|
11 |
-
|
12 |
-
# Gradio interfeysi
|
13 |
-
iface = gr.Interface(
|
14 |
-
fn=chat_with_model,
|
15 |
-
inputs="text",
|
16 |
-
outputs="text",
|
17 |
-
title="RuGPT-3 Small Chatbot",
|
18 |
-
description="Rus tilida matn yaratish uchun AI model"
|
19 |
-
)
|
20 |
-
|
21 |
-
if __name__ == "__main__":
|
22 |
-
iface.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|