manohar02 commited on
Commit
9bdeb47
1 Parent(s): 58eb302

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -1,3 +1,16 @@
1
  import gradio as gr
 
2
 
3
- gr.load("models/manohar02/Llama-2-7b-finetune").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ # Load your model
5
+ summarizer = pipeline("summarization", model="your-username/your-model-name")
6
+
7
+ # Define the summarization function
8
+ def summarize(text):
9
+ summary = summarizer(text, max_length=130, min_length=30, do_sample=False)
10
+ return summary[0]['summary_text']
11
+
12
+ # Set up the Gradio interface
13
+ iface = gr.Interface(fn=summarize, inputs="text", outputs="text", title="Text Summarizer")
14
+
15
+ if __name__ == "__main__":
16
+ iface.launch()