Spaces:
Sleeping
Sleeping
| from transformers import pipeline | |
| import gradio as gr | |
| qa_pipeline = pipeline("text2text-generation", model="Peramanathan/cv-qa-model") | |
| def answer_question(question): | |
| prompt = f"Question: {question}\nAnswer as Peramanathan Sathyamoorthy in a concise, conversational tone:" | |
| response = qa_pipeline(prompt, max_length=150, do_sample=True, temperature=0.7)[0]['generated_text'] | |
| return response.replace("Question:", "").replace("Answer as Peramanathan Sathyamoorthy in a concise, conversational tone:", "").strip() | |
| gr.Interface(fn=answer_question, inputs="text", outputs="text").launch() | |