medical_model / combined_app.py
Deva1211's picture
Modified files for deployment
37244c4
raw
history blame contribute delete
928 Bytes
"""
Combined App for MedLLaMA2 Medical Chatbot
This file runs both the Gradio interface and Flask API server
"""
import threading
import time
import subprocess
import sys
import os
def run_gradio():
"""Run the Gradio app"""
subprocess.run([sys.executable, "app.py"])
def run_api():
"""Run the API server"""
# Wait a bit for the model to load in Gradio
time.sleep(10)
subprocess.run([sys.executable, "api_server.py"])
if __name__ == "__main__":
print("πŸš€ Starting MedLLaMA2 Combined Server...")
print("πŸ“Š This will start both Gradio UI (port 7860) and API server (port 8000)")
# Create threads for both servers
gradio_thread = threading.Thread(target=run_gradio)
api_thread = threading.Thread(target=run_api)
# Start both threads
gradio_thread.start()
api_thread.start()
# Wait for both to complete
gradio_thread.join()
api_thread.join()