Spaces:
Runtime error
Runtime error
zetavg
commited on
Commit
β’
6885a7c
1
Parent(s):
c15d0e4
for ui demo
Browse files- README.md +22 -0
- app_hf_ui_demo.py +33 -0
README.md
CHANGED
@@ -1,3 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# π¦ποΈ LLaMA-LoRA
|
2 |
|
3 |
<a href="https://colab.research.google.com/github/zetavg/LLaMA-LoRA/blob/main/LLaMA_LoRA.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
|
|
|
1 |
+
---
|
2 |
+
title: LLaMA-LoRA UI Demo
|
3 |
+
emoji: π¦ποΈ
|
4 |
+
colorFrom: pink
|
5 |
+
colorTo: gray
|
6 |
+
sdk: gradio
|
7 |
+
sdk_version: 3.24.1
|
8 |
+
python_version: 3.8.9
|
9 |
+
app_file: app_hf_ui_demo.py
|
10 |
+
pinned: false
|
11 |
+
---
|
12 |
+
|
13 |
+
# HF UI DEMO
|
14 |
+
|
15 |
+
To update, run:
|
16 |
+
|
17 |
+
```sh
|
18 |
+
git push -f hf-ui-demo hf-ui-demo:main
|
19 |
+
```
|
20 |
+
|
21 |
+
---
|
22 |
+
|
23 |
# π¦ποΈ LLaMA-LoRA
|
24 |
|
25 |
<a href="https://colab.research.google.com/github/zetavg/LLaMA-LoRA/blob/main/LLaMA_LoRA.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
|
app_hf_ui_demo.py
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import sys
|
3 |
+
|
4 |
+
import fire
|
5 |
+
import gradio as gr
|
6 |
+
|
7 |
+
from llama_lora.globals import Global
|
8 |
+
from llama_lora.ui.main_page import main_page, get_page_title, main_page_custom_css
|
9 |
+
from llama_lora.utils.data import init_data_dir
|
10 |
+
|
11 |
+
|
12 |
+
def main():
|
13 |
+
data_dir = os.path.abspath("./data")
|
14 |
+
Global.base_model = "decapoda-research/llama-7b-hf"
|
15 |
+
Global.data_dir = data_dir
|
16 |
+
Global.load_8bit = False
|
17 |
+
|
18 |
+
Global.ui_dev_mode = True
|
19 |
+
Global.ui_show_sys_info = False
|
20 |
+
|
21 |
+
Global.ui_subtitle = "This is a UI demo of <a href=\"https://github.com/zetavg/LLaMA-LoRA\" target=\"_blank\">LLaMA-LoRA</a>, toolkit for evaluating and fine-tuning LLaMA models."
|
22 |
+
|
23 |
+
os.makedirs(data_dir, exist_ok=True)
|
24 |
+
init_data_dir()
|
25 |
+
|
26 |
+
with gr.Blocks(title=get_page_title(), css=main_page_custom_css()) as demo:
|
27 |
+
main_page()
|
28 |
+
|
29 |
+
demo.queue().launch()
|
30 |
+
|
31 |
+
|
32 |
+
if __name__ == "__main__":
|
33 |
+
fire.Fire(main)
|