Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files
app.py
CHANGED
@@ -42,14 +42,6 @@ import gradio as gr
|
|
42 |
# Load the quantized model
|
43 |
model = load_quantized_model("checkpoint_quantized.pt")
|
44 |
|
45 |
-
# Set the quantization configuration for the embedding layer
|
46 |
-
model.embed_tokens.qconfig = quantization.float_qparams_weight_only_qconfig
|
47 |
-
|
48 |
-
# Apply static quantization to the rest of the model
|
49 |
-
model.qconfig = quantization.default_qconfig
|
50 |
-
model = quantization.prepare(model, inplace=False)
|
51 |
-
model = quantization.convert(model, inplace=False)
|
52 |
-
|
53 |
# Function to generate text
|
54 |
def generate_text(prompt, max_length=50, temperature=1.0, top_k=50):
|
55 |
input_ids = tokenizer.encode(prompt, return_tensors="pt")
|
|
|
42 |
# Load the quantized model
|
43 |
model = load_quantized_model("checkpoint_quantized.pt")
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
# Function to generate text
|
46 |
def generate_text(prompt, max_length=50, temperature=1.0, top_k=50):
|
47 |
input_ids = tokenizer.encode(prompt, return_tensors="pt")
|