Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,6 +32,7 @@ import requests
|
|
| 32 |
|
| 33 |
import chatglm_cpp
|
| 34 |
import gradio as gr
|
|
|
|
| 35 |
from pathlib import Path
|
| 36 |
|
| 37 |
model_file_path = "chatglm2-ggml-q4_0.bin"
|
|
@@ -442,6 +443,30 @@ with gr.Blocks(css = css) as demo:
|
|
| 442 |
)
|
| 443 |
#g_frame = gr.Matrix(sub_l_square, label = sub_first,)
|
| 444 |
frame_list.append(g_frame)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 445 |
with gr.Column():
|
| 446 |
with gr.Row():
|
| 447 |
with gr.Column():
|
|
|
|
| 32 |
|
| 33 |
import chatglm_cpp
|
| 34 |
import gradio as gr
|
| 35 |
+
from huggingface_hub import space_info
|
| 36 |
from pathlib import Path
|
| 37 |
|
| 38 |
model_file_path = "chatglm2-ggml-q4_0.bin"
|
|
|
|
| 443 |
)
|
| 444 |
#g_frame = gr.Matrix(sub_l_square, label = sub_first,)
|
| 445 |
frame_list.append(g_frame)
|
| 446 |
+
|
| 447 |
+
markdown_exp_size = "#"
|
| 448 |
+
lora_repo = "svjack/chatglm3-few-shot"
|
| 449 |
+
lora_repo_link = "svjack/chatglm3-few-shot/?input_list_index=0"
|
| 450 |
+
emoji = space_info(lora_repo).__dict__["cardData"]["emoji"]
|
| 451 |
+
space_cnt = 1
|
| 452 |
+
task_name = "ChengYu to Emojis"
|
| 453 |
+
gr.Markdown(
|
| 454 |
+
value=f"{markdown_exp_size} {space_cnt}. Check {task_name} few shot prompt in this repo by visit ChatGLM3 Few Shot space repo (click submit to activate) : [{lora_repo}](https://huggingface.co/spaces/{lora_repo_link}) {emoji}",
|
| 455 |
+
visible=True,
|
| 456 |
+
elem_id="selected_space",
|
| 457 |
+
)
|
| 458 |
+
|
| 459 |
+
lora_repo = "svjack/chatglm3-few-shot"
|
| 460 |
+
lora_repo_link = "svjack/chatglm3-few-shot/?input_list_index=1"
|
| 461 |
+
emoji = space_info(lora_repo).__dict__["cardData"]["emoji"]
|
| 462 |
+
space_cnt = 2
|
| 463 |
+
task_name = "Emojis to image prompt"
|
| 464 |
+
gr.Markdown(
|
| 465 |
+
value=f"{markdown_exp_size} {space_cnt}. Check {task_name} few shot prompt in this repo by visit ChatGLM3 Few Shot space repo (click submit to activate) : [{lora_repo}](https://huggingface.co/spaces/{lora_repo_link}) {emoji}",
|
| 466 |
+
visible=True,
|
| 467 |
+
elem_id="selected_space",
|
| 468 |
+
)
|
| 469 |
+
|
| 470 |
with gr.Column():
|
| 471 |
with gr.Row():
|
| 472 |
with gr.Column():
|