0x7o commited on
Commit
d9b1afb
1 Parent(s): 9b150da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -13
app.py CHANGED
@@ -7,10 +7,9 @@ from typing import Iterator
7
 
8
  model_id = "mistralai/Mistral-Nemo-Instruct-2407"
9
 
10
-
11
  MAX_INPUT_TOKEN_LENGTH = 4096
12
 
13
- # Загрузка токенизатора и модели
14
  tokenizer = AutoTokenizer.from_pretrained(model_id)
15
  model = AutoModelForCausalLM.from_pretrained(
16
  model_id,
@@ -55,24 +54,23 @@ def generate(
55
  outputs.append(text)
56
  yield "".join(outputs)
57
 
58
-
59
- # Настройка интерфейса Gradio
60
  iface = gr.ChatInterface(
61
  generate,
62
  chatbot=gr.Chatbot(height=600),
63
- textbox=gr.Textbox(placeholder="Введите ваше сообщение здесь...", container=False, scale=7),
64
- title="Чат с Aeonium v1.1",
65
- description="Это чат-интерфейс для модели Aeonium v1.1 Chat 4B. Задавайте вопросы и получайте ответы!",
66
  theme="soft",
67
- retry_btn="Повторить",
68
- undo_btn="Отменить последнее",
69
- clear_btn="Очистить",
70
  additional_inputs=[
71
- gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Максимальное количество новых токенов"),
72
- gr.Slider(minimum=0.1, maximum=2.0, value=0.7, step=0.1, label="Температура"),
73
  gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)"),
74
  ],
75
  )
76
 
77
- # Запуск интерфейса
78
  iface.launch()
 
7
 
8
  model_id = "mistralai/Mistral-Nemo-Instruct-2407"
9
 
 
10
  MAX_INPUT_TOKEN_LENGTH = 4096
11
 
12
+ # Load tokenizer and model
13
  tokenizer = AutoTokenizer.from_pretrained(model_id)
14
  model = AutoModelForCausalLM.from_pretrained(
15
  model_id,
 
54
  outputs.append(text)
55
  yield "".join(outputs)
56
 
57
+ # Set up Gradio interface
 
58
  iface = gr.ChatInterface(
59
  generate,
60
  chatbot=gr.Chatbot(height=600),
61
+ textbox=gr.Textbox(placeholder="Enter your message here...", container=False, scale=7),
62
+ title="Chat with Mistral Next v1.1",
63
+ description="This is a chat interface for the Mistral Next v1.1 Chat 4B model. Ask questions and get answers!",
64
  theme="soft",
65
+ retry_btn="Retry",
66
+ undo_btn="Undo Last",
67
+ clear_btn="Clear",
68
  additional_inputs=[
69
+ gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Maximum number of new tokens"),
70
+ gr.Slider(minimum=0.1, maximum=2.0, value=0.7, step=0.1, label="Temperature"),
71
  gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)"),
72
  ],
73
  )
74
 
75
+ # Launch the interface
76
  iface.launch()