Spaces:
Sleeping
Sleeping
Commit
·
bdc6b1a
1
Parent(s):
fbe0733
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,27 @@ import streamlit as st
|
|
2 |
import uuid
|
3 |
import sys
|
4 |
import requests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
USER_ICON = "images/user-icon.png"
|
7 |
AI_ICON = "images/ai-icon.png"
|
@@ -103,25 +124,7 @@ def handle_input():
|
|
103 |
# from pprint import pprint
|
104 |
# import json
|
105 |
|
106 |
-
|
107 |
-
import pandas as pd
|
108 |
-
import torch
|
109 |
-
import torch.nn as nn
|
110 |
-
import transformers
|
111 |
-
from datasets import load_dataset
|
112 |
-
from huggingface_hub import notebook_login
|
113 |
-
from peft import (
|
114 |
-
LoraConfig,
|
115 |
-
PeftConfig,
|
116 |
-
get_peft_model,
|
117 |
-
prepare_model_for_kbit_training,
|
118 |
-
)
|
119 |
-
from transformers import (
|
120 |
-
AutoConfig,
|
121 |
-
AutoModelForCausalLM,
|
122 |
-
AutoTokenizer,
|
123 |
-
BitsAndBytesConfig,
|
124 |
-
)
|
125 |
|
126 |
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
|
127 |
|
@@ -141,7 +144,6 @@ def handle_input():
|
|
141 |
You can also directly load adapters from the Hub using the commands below:
|
142 |
"""
|
143 |
|
144 |
-
from peft import *
|
145 |
|
146 |
# change peft_model_id
|
147 |
bnb_config = BitsAndBytesConfig(
|
|
|
2 |
import uuid
|
3 |
import sys
|
4 |
import requests
|
5 |
+
from peft import *
|
6 |
+
import bitsandbytes as bnb
|
7 |
+
import pandas as pd
|
8 |
+
import torch
|
9 |
+
import torch.nn as nn
|
10 |
+
import transformers
|
11 |
+
from datasets import load_dataset
|
12 |
+
from huggingface_hub import notebook_login
|
13 |
+
from peft import (
|
14 |
+
LoraConfig,
|
15 |
+
PeftConfig,
|
16 |
+
get_peft_model,
|
17 |
+
prepare_model_for_kbit_training,
|
18 |
+
)
|
19 |
+
from transformers import (
|
20 |
+
AutoConfig,
|
21 |
+
AutoModelForCausalLM,
|
22 |
+
AutoTokenizer,
|
23 |
+
BitsAndBytesConfig,
|
24 |
+
)
|
25 |
+
|
26 |
|
27 |
USER_ICON = "images/user-icon.png"
|
28 |
AI_ICON = "images/ai-icon.png"
|
|
|
124 |
# from pprint import pprint
|
125 |
# import json
|
126 |
|
127 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
|
130 |
|
|
|
144 |
You can also directly load adapters from the Hub using the commands below:
|
145 |
"""
|
146 |
|
|
|
147 |
|
148 |
# change peft_model_id
|
149 |
bnb_config = BitsAndBytesConfig(
|