Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,8 @@ import os
|
|
9 |
#import gdown
|
10 |
#url = 'https://drive.google.com/drive/folders/135hTTURfjn43fo4f?usp=sharing' # I'm showing a fake token
|
11 |
#gdown.download_folder(url)
|
12 |
-
os.system("sudo apt-get install git-lfs")
|
13 |
-
os.system("git clone https://huggingface.co/AfnanAl/summaryAonnx")
|
14 |
|
15 |
#m=os.system("gdown https://drive.google.com/file/d/152leR0f_2RXIVyZxV1ZYDpRMMYYGBhOk/view?usp=sharing")
|
16 |
|
@@ -18,10 +18,14 @@ os.system("git clone https://huggingface.co/AfnanAl/summaryAonnx")
|
|
18 |
|
19 |
tokenizer = T5Tokenizer.from_pretrained("AfnanAl/mT5small-ArabicSummary")
|
20 |
|
21 |
-
model_name="AfnanAl/mT5small-ArabicSummary"
|
22 |
-
custom_output_path="summaryAonnx/"
|
|
|
|
|
|
|
|
|
23 |
#modelO = quantize("AfnanAl/summaryAonnx")
|
24 |
-
modelO=get_onnx_model(
|
25 |
modelO.config.max_length=512
|
26 |
def summaryA(Text):
|
27 |
tokenized_text = tokenizer.encode(Text,return_tensors="pt")
|
|
|
9 |
#import gdown
|
10 |
#url = 'https://drive.google.com/drive/folders/135hTTURfjn43fo4f?usp=sharing' # I'm showing a fake token
|
11 |
#gdown.download_folder(url)
|
12 |
+
#os.system("sudo apt-get install git-lfs")
|
13 |
+
#os.system("git clone https://huggingface.co/AfnanAl/summaryAonnx")
|
14 |
|
15 |
#m=os.system("gdown https://drive.google.com/file/d/152leR0f_2RXIVyZxV1ZYDpRMMYYGBhOk/view?usp=sharing")
|
16 |
|
|
|
18 |
|
19 |
tokenizer = T5Tokenizer.from_pretrained("AfnanAl/mT5small-ArabicSummary")
|
20 |
|
21 |
+
#model_name="AfnanAl/mT5small-ArabicSummary"
|
22 |
+
#custom_output_path="summaryAonnx/"
|
23 |
+
quantized_model = torch.quantization.quantize_dynamic(
|
24 |
+
"AfnanAl/summaryAonnx", dtype=torch.qint8
|
25 |
+
)
|
26 |
+
#print(quantized_model)
|
27 |
#modelO = quantize("AfnanAl/summaryAonnx")
|
28 |
+
modelO=get_onnx_model(quantized_model )
|
29 |
modelO.config.max_length=512
|
30 |
def summaryA(Text):
|
31 |
tokenized_text = tokenizer.encode(Text,return_tensors="pt")
|