cofeg commited on
Commit
661320e
·
verified ·
1 Parent(s): 219e79a

fix: config error

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -2,13 +2,10 @@ import os
2
  from huggingface_hub import InferenceClient
3
  import gradio as gr
4
  import re
5
- import sys
6
- sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
7
- from config.config import *
8
 
9
- os.environ['CURL_CA_BUNDLE'] = '' # Avoid SSL error
10
- hugging_face_model_path = HUGGING_FACE_USER_NAME + "/" + MERGED_MODEL_NAME
11
- client = InferenceClient(model=hugging_face_model_path, token=HUGGING_FACE_TOKEN)
12
 
13
  def split_and_generate(modern_text):
14
  # Split the input text into sentences for the model is trained on sentence pairs
@@ -25,6 +22,6 @@ demo = gr.Interface(fn=split_and_generate,
25
  inputs=[gr.Textbox(label="现代文", lines=10)],
26
  outputs=[gr.Textbox(label="古文", lines=10)],
27
  title="现代文转古文大模型",
28
- description="请在左边对话框输入你要转换的现代文并点击“Submit”按钮,耐心等待一两分钟,右边的对话框将显示转换后的古文。\n由于训练数据来源于《徐霞客游记》,故对游记类文字转换效果较好。"
29
  )
30
- demo.launch()
 
2
  from huggingface_hub import InferenceClient
3
  import gradio as gr
4
  import re
 
 
 
5
 
6
+ hugging_face_model_path = "cofeg/Finetuned-Xunzi-Qwen2-1.5B-for-ancient-text-generation"
7
+
8
+ client = InferenceClient(model=hugging_face_model_path, token=os.getenv('HUGGING_FACE_TOKEN'))
9
 
10
  def split_and_generate(modern_text):
11
  # Split the input text into sentences for the model is trained on sentence pairs
 
22
  inputs=[gr.Textbox(label="现代文", lines=10)],
23
  outputs=[gr.Textbox(label="古文", lines=10)],
24
  title="现代文转古文大模型",
25
+ description="请在左边对话框输入你要转换的现代文并点击“Submit”按钮,耐心等待一两分钟,右边的对话框将显示转换后的古文。<br>由于训练数据来源于《徐霞客游记》,故对游记类文字转换效果较好。"
26
  )
27
+ demo.launch()