Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,6 @@ feature_extractor = ViTFeatureExtractor.from_pretrained(encoder_checkpoint)
|
|
17 |
tokenizer = AutoTokenizer.from_pretrained(decoder_checkpoint)
|
18 |
model = VisionEncoderDecoderModel.from_pretrained(model_checkpoint).to(device)
|
19 |
|
20 |
-
|
21 |
def predict(image, max_length=64, num_beams=4):
|
22 |
image = image.convert('RGB')
|
23 |
image = feature_extractor(image, return_tensors="pt").pixel_values.to(device)
|
@@ -41,6 +40,7 @@ with gr.Blocks() as demo:
|
|
41 |
</h1>
|
42 |
<h2 style="text-align: left; font-weight: 450; font-size: 1rem; margin-top: 2rem; margin-bottom: 1.5rem">
|
43 |
In the field of large language models, the challenge of fine-tuning has long perplexed researchers. Microsoft, however, has unveiled an innovative solution called <b>Low-Rank Adaptation (LoRA)</b>. With the emergence of behemoth models like GPT-3 boasting billions of parameters, the cost of fine-tuning them for specific tasks or domains has become exorbitant.
|
|
|
44 |
LoRA offers a groundbreaking approach by freezing the weights of pre-trained models and introducing trainable layers known as <b>rank-decomposition matrices in each transformer block</b>. This ingenious technique significantly reduces the number of trainable parameters and minimizes GPU memory requirements, as gradients no longer need to be computed for the majority of model weights.
|
45 |
<br>
|
46 |
<br>
|
@@ -58,8 +58,7 @@ with gr.Blocks() as demo:
|
|
58 |
out = gr.outputs.Textbox(type="text",label="Captions")
|
59 |
|
60 |
button.click(predict, inputs=[img], outputs=[out])
|
61 |
-
|
62 |
-
|
63 |
gr.Examples(
|
64 |
examples=examples,
|
65 |
inputs=img,
|
|
|
17 |
tokenizer = AutoTokenizer.from_pretrained(decoder_checkpoint)
|
18 |
model = VisionEncoderDecoderModel.from_pretrained(model_checkpoint).to(device)
|
19 |
|
|
|
20 |
def predict(image, max_length=64, num_beams=4):
|
21 |
image = image.convert('RGB')
|
22 |
image = feature_extractor(image, return_tensors="pt").pixel_values.to(device)
|
|
|
40 |
</h1>
|
41 |
<h2 style="text-align: left; font-weight: 450; font-size: 1rem; margin-top: 2rem; margin-bottom: 1.5rem">
|
42 |
In the field of large language models, the challenge of fine-tuning has long perplexed researchers. Microsoft, however, has unveiled an innovative solution called <b>Low-Rank Adaptation (LoRA)</b>. With the emergence of behemoth models like GPT-3 boasting billions of parameters, the cost of fine-tuning them for specific tasks or domains has become exorbitant.
|
43 |
+
<br>
|
44 |
LoRA offers a groundbreaking approach by freezing the weights of pre-trained models and introducing trainable layers known as <b>rank-decomposition matrices in each transformer block</b>. This ingenious technique significantly reduces the number of trainable parameters and minimizes GPU memory requirements, as gradients no longer need to be computed for the majority of model weights.
|
45 |
<br>
|
46 |
<br>
|
|
|
58 |
out = gr.outputs.Textbox(type="text",label="Captions")
|
59 |
|
60 |
button.click(predict, inputs=[img], outputs=[out])
|
61 |
+
|
|
|
62 |
gr.Examples(
|
63 |
examples=examples,
|
64 |
inputs=img,
|