Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -23,11 +23,10 @@ model.load_adapter(adapter_path)
|
|
| 23 |
def inference(prompt):
|
| 24 |
|
| 25 |
pipe = pipeline(task="text-generation",model=model,tokenizer=tokenizer,max_length = 100)
|
| 26 |
-
|
| 27 |
-
result = pipe(f"{prompt}")
|
| 28 |
return result[0]['generated_text']
|
| 29 |
|
| 30 |
-
INTERFACE = gr.Interface(fn=inference, inputs=[gr.Textbox(label= "Prompt", value= '
|
| 31 |
|
| 32 |
outputs=gr.Text(label= "Generated Text"), title="Language Model Phi-2 fine-tuned with OpenAssistant/oasst-1 dataset using QLoRA strategy",
|
| 33 |
|
|
|
|
| 23 |
def inference(prompt):
|
| 24 |
|
| 25 |
pipe = pipeline(task="text-generation",model=model,tokenizer=tokenizer,max_length = 100)
|
| 26 |
+
result = pipe(f"<s>[INST] {prompt} [/INST]")
|
|
|
|
| 27 |
return result[0]['generated_text']
|
| 28 |
|
| 29 |
+
INTERFACE = gr.Interface(fn=inference, inputs=[gr.Textbox(label= "Prompt", value= 'what should we do to save time')],
|
| 30 |
|
| 31 |
outputs=gr.Text(label= "Generated Text"), title="Language Model Phi-2 fine-tuned with OpenAssistant/oasst-1 dataset using QLoRA strategy",
|
| 32 |
|