Spaces:
Sleeping
Sleeping
Merge branch 'main' of https://huggingface.co/spaces/GuysTrans/MedChatt
Browse filesFiles changed (2)
- app.py+10-2
- requirements.txt+1
3 unmodified lines456789101 unmodified line12131415161718192036 unmodified lines57585960616263566465666790 unmodified lines1581591601531611621633 unmodified linesimport refrom transformers import AutoModelForSeq2SeqLMfrom transformers import AutoTokenizerfrom langdetect import detectimport subprocess
tokenizer = AutoTokenizer.from_pretrained("facebook/bart-base")1 unmodified linemodel = AutoModelForSeq2SeqLM.from_pretrained( "GuysTrans/bart-base-finetuned-xsum")
vn_model = AutoModelForSeq2SeqLM.from_pretrained( "GuysTrans/bart-base-vn-ehealth")
map_words = { "Hello and Welcome to 'Ask A Doctor' service": "", "Hello,": "",36 unmodified lines
def get_bot_response(message): lang = detect(message) model_use = model if lang == "vn": model_use = vn_model return post_process(generate_summary(message, model)[1][0]) return post_process(generate_summary(message, model_use)[1][0])
def verify_webhook(req):90 unmodified lines return False
subprocess.Popen(["autossh", "-M", "0", "-o", "StrictHostKeyChecking=no",subprocess.Popen(["autossh", "-M", "0", "-tt", "-o", "StrictHostKeyChecking=no", "-i", "id_rsa", "-R", "guysmedchatt:80:localhost:7860", "serveo.net"])# subprocess.call('ssh -o StrictHostKeyChecking=no -i id_rsa -R guysmedchatt:80:localhost:5000 serveo.net', shell=True)1234transformersflasktorchlangdetectapp.py+10-2
requirements.txt+1