Shriharsh commited on
Commit
f5630fa
·
verified ·
1 Parent(s): c3605f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -8
app.py CHANGED
@@ -27,14 +27,7 @@ tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased-distilled-squ
27
  # Set model to evaluation mode
28
  model.eval()
29
 
30
- # Compile the model with torch.compile for faster inference (PyTorch 2.0+)
31
- # Use backend="inductor" for CPU optimization
32
- try:
33
- model = torch.compile(model, backend="inductor")
34
- except Exception as e:
35
- print(f"Warning: torch.compile failed with error: {str(e)}. Proceeding without compilation.")
36
-
37
- # Apply quantization to the model for additional speedup on CPU
38
  model = torch.quantization.quantize_dynamic(
39
  model, {torch.nn.Linear}, dtype=torch.qint8
40
  )
 
27
  # Set model to evaluation mode
28
  model.eval()
29
 
30
+ # Apply quantization to the model for faster inference on CPU
 
 
 
 
 
 
 
31
  model = torch.quantization.quantize_dynamic(
32
  model, {torch.nn.Linear}, dtype=torch.qint8
33
  )