Sakalti commited on
Commit
fa42bef
·
verified ·
1 Parent(s): 1596bb5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import gradio as gr
2
  from modelscope.pipelines import pipeline
3
  from modelscope.utils.constant import Tasks
 
4
 
5
  # 使用可能なモデルのリスト
6
  models = ["Qwen/Qwen2.5-7B-Instruct", "Qwen/Qwen2.5-14B-Instruct", "Qwen/Qwen2.5-32B-Instruct"]
@@ -17,7 +18,7 @@ def respond(
17
  # 型変換: selected_modelを文字列に変換
18
  selected_model = str(selected_model)
19
 
20
- # 選択したモデルに基づいてPipeline を初期化
21
  pipe = pipeline(task=Tasks.text_generation, model=selected_model)
22
 
23
  messages = [{"role": "system", "content": system_message}]
 
1
  import gradio as gr
2
  from modelscope.pipelines import pipeline
3
  from modelscope.utils.constant import Tasks
4
+ import swift # swift モジュールのインポートを追加
5
 
6
  # 使用可能なモデルのリスト
7
  models = ["Qwen/Qwen2.5-7B-Instruct", "Qwen/Qwen2.5-14B-Instruct", "Qwen/Qwen2.5-32B-Instruct"]
 
18
  # 型変換: selected_modelを文字列に変換
19
  selected_model = str(selected_model)
20
 
21
+ # 選択したモデルに基づいてPipelineを初期化
22
  pipe = pipeline(task=Tasks.text_generation, model=selected_model)
23
 
24
  messages = [{"role": "system", "content": system_message}]