Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -4,4 +4,14 @@ def greet(name):
|
|
4 |
return "Hello " + name + "!!"
|
5 |
|
6 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
return "Hello " + name + "!!"
|
5 |
|
6 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
+
demo.launch()
|
8 |
+
|
9 |
+
from peft import AutoPeftModelForSeq2SeqLM
|
10 |
+
|
11 |
+
base_model_id = "facebook/nllb-200-distilled-600M"
|
12 |
+
adapter_model_id = "your-adapter-repo"
|
13 |
+
|
14 |
+
peft_model = AutoPeftModelForSeq2SeqLM.from_pretrained(base_model_id, adapter_model_id)
|
15 |
+
|
16 |
+
# now you can call the merge_and_unload method which returns a regular NLLB model which you can use for inference
|
17 |
+
model = peft_model.merge_and_unload()
|