Peramanathan commited on
Commit
bde8a0b
·
unverified ·
1 Parent(s): 66b42e9

Add application file

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+ qa_pipeline = pipeline("text2text-generation", model="your-username/cv-qa-model")
5
+
6
+ def answer_question(question):
7
+ prompt = f"Question: {question}\nAnswer as Peramanathan Sathyamoorthy in a concise, conversational tone:"
8
+ response = qa_pipeline(prompt, max_length=150, do_sample=True, temperature=0.7)[0]['generated_text']
9
+ return response.replace("Question:", "").replace("Answer as Peramanathan Sathyamoorthy in a concise, conversational tone:", "").strip()
10
+
11
+ gr.Interface(fn=answer_question, inputs="text", outputs="text").launch()