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 lines4567891 unmodified line11121314151636 unmodified lines5354555657585990 unmodified lines1501511521531541553 unmodified linesimport refrom transformers import AutoModelForSeq2SeqLMfrom transformers import AutoTokenizerimport subprocesstokenizer = AutoTokenizer.from_pretrained("facebook/bart-base")1 unmodified linemodel = AutoModelForSeq2SeqLM.from_pretrained("GuysTrans/bart-base-finetuned-xsum")map_words = {"Hello and Welcome to 'Ask A Doctor' service": "","Hello,": "",36 unmodified linesdef get_bot_response(message):return post_process(generate_summary(message, model)[1][0])def verify_webhook(req):90 unmodified linesreturn Falsesubprocess.Popen(["autossh", "-M", "0", "-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)3 unmodified lines456789101 unmodified line12131415161718192036 unmodified lines575859606162636465666790 unmodified lines1581591601611621633 unmodified linesimport refrom transformers import AutoModelForSeq2SeqLMfrom transformers import AutoTokenizerfrom langdetect import detectimport subprocesstokenizer = 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 linesdef get_bot_response(message):lang = detect(message)model_use = modelif lang == "vn":model_use = vn_modelreturn post_process(generate_summary(message, model_use)[1][0])def verify_webhook(req):90 unmodified linesreturn Falsesubprocess.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)
123transformersflasktorch1234transformersflasktorchlangdetect
app.py+10-2
requirements.txt+1