root commited on
Commit
46b9cd3
1 Parent(s): e9a7dd4
Files changed (1) hide show
  1. app.py +40 -2
app.py CHANGED
@@ -74,9 +74,47 @@ md = f'''# <center>{model_name.split('/')[-1]}</center>
74
  Ovis has been open-sourced on [GitHub](https://github.com/AIDC-AI/Ovis) and [Huggingface](https://huggingface.co/{model_name}). If you find Ovis useful, a star or a like would be appreciated.
75
  '''
76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  text_input = gr.Textbox(label="prompt", placeholder="Enter your text here...", lines=1, container=False)
78
  with gr.Blocks(title=model_name.split('/')[-1]) as demo:
79
- gr.Markdown(md)
 
80
  cur_dir = os.path.dirname(os.path.abspath(__file__))
81
  with gr.Row():
82
  with gr.Column(scale=3):
@@ -87,7 +125,7 @@ with gr.Blocks(title=model_name.split('/')[-1]) as demo:
87
  inputs=[image_input, text_input]
88
  )
89
  with gr.Column(scale=7):
90
- chatbot = gr.Chatbot(label="Ovis", layout="panel", height=470, show_copy_button=True)
91
  text_input.render()
92
  with gr.Row():
93
  send_btn = gr.Button("Send", variant="primary")
 
74
  Ovis has been open-sourced on [GitHub](https://github.com/AIDC-AI/Ovis) and [Huggingface](https://huggingface.co/{model_name}). If you find Ovis useful, a star or a like would be appreciated.
75
  '''
76
 
77
+ html = f"""
78
+ <center><font size=8> {model_name.split('/')[-1]}</font></center>
79
+ <center><font size=3>Ovis has been open-sourced on <a href='https://github.com/AIDC-AI/Ovis'>GitHub</a> and <a href='https://huggingface.co/{model_name}'>Huggingface</a>. If you find Ovis useful, a star or a like would be appreciated.</font></center>
80
+ """
81
+
82
+
83
+ latex_delimiters_set = [{
84
+ "left": "\\(",
85
+ "right": "\\)",
86
+ "display": False # 行内公式
87
+ }, {
88
+ "left": "\\begin{equation}",
89
+ "right": "\\end{equation}",
90
+ "display": True # 块级公式
91
+ }, {
92
+ "left": "\\begin{align}",
93
+ "right": "\\end{align}",
94
+ "display": True # 块级公式
95
+ }, {
96
+ "left": "\\begin{alignat}",
97
+ "right": "\\end{alignat}",
98
+ "display": True # 块级公式
99
+ }, {
100
+ "left": "\\begin{gather}",
101
+ "right": "\\end{gather}",
102
+ "display": True # 块级公式
103
+ }, {
104
+ "left": "\\begin{CD}",
105
+ "right": "\\end{CD}",
106
+ "display": True # 块级公式
107
+ }, {
108
+ "left": "\\[",
109
+ "right": "\\]",
110
+ "display": True # 块级公式
111
+ }]
112
+
113
+
114
  text_input = gr.Textbox(label="prompt", placeholder="Enter your text here...", lines=1, container=False)
115
  with gr.Blocks(title=model_name.split('/')[-1]) as demo:
116
+ # gr.Markdown(md)
117
+ gr.HTML(html)
118
  cur_dir = os.path.dirname(os.path.abspath(__file__))
119
  with gr.Row():
120
  with gr.Column(scale=3):
 
125
  inputs=[image_input, text_input]
126
  )
127
  with gr.Column(scale=7):
128
+ chatbot = gr.Chatbot(label="Ovis", layout="panel", height=800, show_copy_button=True, latex_delimiters=latex_delimiters_set)
129
  text_input.render()
130
  with gr.Row():
131
  send_btn = gr.Button("Send", variant="primary")