Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ MODEL_NAME = "warleagle/medical_chat_saiga"
|
|
| 9 |
config = PeftConfig.from_pretrained(MODEL_NAME)
|
| 10 |
model = AutoModelForCausalLM.from_pretrained(
|
| 11 |
config.base_model_name_or_path,
|
| 12 |
-
|
| 13 |
torch_dtype=torch.float16,
|
| 14 |
device_map="auto"
|
| 15 |
)
|
|
@@ -42,7 +42,7 @@ def predict(input_data, temp):
|
|
| 42 |
|
| 43 |
conversation = Conversation()
|
| 44 |
conversation.add_user_message(input_data)
|
| 45 |
-
prompt = conversation.get_prompt(
|
| 46 |
|
| 47 |
output = generate(model, tokenizer, prompt, generation_config)
|
| 48 |
return output
|
|
|
|
| 9 |
config = PeftConfig.from_pretrained(MODEL_NAME)
|
| 10 |
model = AutoModelForCausalLM.from_pretrained(
|
| 11 |
config.base_model_name_or_path,
|
| 12 |
+
load_in_8bit=True,
|
| 13 |
torch_dtype=torch.float16,
|
| 14 |
device_map="auto"
|
| 15 |
)
|
|
|
|
| 42 |
|
| 43 |
conversation = Conversation()
|
| 44 |
conversation.add_user_message(input_data)
|
| 45 |
+
prompt = conversation.get_prompt()
|
| 46 |
|
| 47 |
output = generate(model, tokenizer, prompt, generation_config)
|
| 48 |
return output
|