Spaces:
Sleeping
Sleeping
Yurii Paniv
commited on
Commit
·
08127ab
1
Parent(s):
6e047fb
Lower limit
Browse files
app.py
CHANGED
|
@@ -16,12 +16,12 @@ quant_config = BitsAndBytesConfig(
|
|
| 16 |
)
|
| 17 |
|
| 18 |
model = MistralForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1",
|
| 19 |
-
quantization_config=quant_config,)
|
| 20 |
#device_map="auto",)
|
| 21 |
model = PeftModel.from_pretrained(model, "lang-uk/dragoman")
|
| 22 |
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.1", use_fast=False, add_bos_token=False)
|
| 23 |
|
| 24 |
-
@spaces.GPU(duration=
|
| 25 |
def translate(input_text):
|
| 26 |
# iteratively generate
|
| 27 |
input_text = input_text.strip()
|
|
|
|
| 16 |
)
|
| 17 |
|
| 18 |
model = MistralForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1",
|
| 19 |
+
quantization_config=quant_config,)#.to("cuda")
|
| 20 |
#device_map="auto",)
|
| 21 |
model = PeftModel.from_pretrained(model, "lang-uk/dragoman")
|
| 22 |
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.1", use_fast=False, add_bos_token=False)
|
| 23 |
|
| 24 |
+
@spaces.GPU(duration=20)
|
| 25 |
def translate(input_text):
|
| 26 |
# iteratively generate
|
| 27 |
input_text = input_text.strip()
|