Spaces:
Sleeping
Sleeping
Test
Browse files
app.py
CHANGED
@@ -3,20 +3,17 @@ from peft import PeftModel
|
|
3 |
from transformers import TextStreamer
|
4 |
|
5 |
# Load model directly
|
6 |
-
from transformers import
|
7 |
|
8 |
"""
|
9 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
10 |
Info of how to use a model after training on hf https://huggingface.co/docs/trl/main/en/use_model
|
11 |
"""
|
12 |
|
13 |
-
|
14 |
-
|
15 |
|
16 |
-
|
17 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
|
18 |
-
|
19 |
-
model = PeftModel.from_pretrained(model, adapter_name)
|
20 |
|
21 |
|
22 |
def respond(
|
|
|
3 |
from transformers import TextStreamer
|
4 |
|
5 |
# Load model directly
|
6 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
7 |
|
8 |
"""
|
9 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
10 |
Info of how to use a model after training on hf https://huggingface.co/docs/trl/main/en/use_model
|
11 |
"""
|
12 |
|
13 |
+
peft_model_id = "samlama111/lora_model"
|
14 |
+
model = AutoModelForCausalLM.from_pretrained(peft_model_id)
|
15 |
|
16 |
+
tokenizer = AutoTokenizer.from_pretrained("samlama111/lora_model")
|
|
|
|
|
|
|
17 |
|
18 |
|
19 |
def respond(
|