Spaces:
Runtime error
Runtime error
vaishakgkumar
commited on
Commit
·
4cb428b
1
Parent(s):
97822ab
Update app.py
Browse files
app.py
CHANGED
@@ -49,18 +49,17 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
49 |
|
50 |
# Use the base model's ID
|
51 |
base_model_id = "stabilityai/stablelm-3b-4e1t"
|
52 |
-
model_directory = "
|
53 |
-
|
54 |
# Instantiate the Tokenizer
|
55 |
tokenizer = AutoTokenizer.from_pretrained("stabilityai/stablelm-3b-4e1t", token=hf_token, trust_remote_code=True, padding_side="left")
|
56 |
-
# tokenizer = AutoTokenizer.from_pretrained("
|
57 |
tokenizer.pad_token = tokenizer.eos_token
|
58 |
tokenizer.padding_side = 'left'
|
59 |
|
60 |
# Load the PEFT model
|
61 |
-
peft_config = PeftConfig.from_pretrained("
|
62 |
peft_model = AutoModelForCausalLM.from_pretrained("stabilityai/stablelm-3b-4e1t", token=hf_token, trust_remote_code=True)
|
63 |
-
peft_model = PeftModel.from_pretrained(peft_model, "
|
64 |
|
65 |
class ChatBot:
|
66 |
def __init__(self):
|
@@ -93,9 +92,7 @@ bot = ChatBot()
|
|
93 |
|
94 |
title = "👋🏻Welcome to Tonic's 😷StableMed⚕️ Chat🦟"
|
95 |
description = """
|
96 |
-
You can use this Space to test out the current model
|
97 |
-
You can also use 😷StableMed⚕️ on your laptop & by cloning this space. 🧬🔬🔍 Simply click here: <a style="display:inline-block" href="https://huggingface.co/spaces/Tonic/StableMed_Chat?duplicate=true"><img src="https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14" alt="Duplicate Space"></a></h3>
|
98 |
-
Join us : 🌟TeamTonic🌟 is always making cool demos! Join our active builder's🛠️community on 👻Discord: [Discord](https://discord.gg/GWpVpekp) On 🤗Huggingface: [TeamTonic](https://huggingface.co/TeamTonic) & [MultiTransformer](https://huggingface.co/MultiTransformer) On 🌐Github: [Polytonic](https://github.com/tonic-ai) & contribute to 🌟 [PolyGPT](https://github.com/tonic-ai/polygpt-alpha)
|
99 |
"""
|
100 |
examples = [["What is the proper treatment for buccal herpes?", "Please provide information on the most effective antiviral medications and home remedies for treating buccal herpes."]]
|
101 |
|
|
|
49 |
|
50 |
# Use the base model's ID
|
51 |
base_model_id = "stabilityai/stablelm-3b-4e1t"
|
52 |
+
model_directory = "vaishakgkumar/stablemedv3
|
|
|
53 |
# Instantiate the Tokenizer
|
54 |
tokenizer = AutoTokenizer.from_pretrained("stabilityai/stablelm-3b-4e1t", token=hf_token, trust_remote_code=True, padding_side="left")
|
55 |
+
# tokenizer = AutoTokenizer.from_pretrained("vaishakgkumar/stablemedv3", trust_remote_code=True, padding_side="left")
|
56 |
tokenizer.pad_token = tokenizer.eos_token
|
57 |
tokenizer.padding_side = 'left'
|
58 |
|
59 |
# Load the PEFT model
|
60 |
+
peft_config = PeftConfig.from_pretrained("vaishakgkumar/stablemedv3", token=hf_token)
|
61 |
peft_model = AutoModelForCausalLM.from_pretrained("stabilityai/stablelm-3b-4e1t", token=hf_token, trust_remote_code=True)
|
62 |
+
peft_model = PeftModel.from_pretrained(peft_model, "vaishakgkumar/stablemedv3", token=hf_token)
|
63 |
|
64 |
class ChatBot:
|
65 |
def __init__(self):
|
|
|
92 |
|
93 |
title = "👋🏻Welcome to Tonic's 😷StableMed⚕️ Chat🦟"
|
94 |
description = """
|
95 |
+
You can use this Space to test out the current model vaishakgkumar/stablemedv3
|
|
|
|
|
96 |
"""
|
97 |
examples = [["What is the proper treatment for buccal herpes?", "Please provide information on the most effective antiviral medications and home remedies for treating buccal herpes."]]
|
98 |
|