srivatsavdamaraju commited on
Commit
c4a1cad
·
verified ·
1 Parent(s): 0156b17

Upload 4 files

Browse files
Files changed (4) hide show
  1. Dockerfile +16 -0
  2. README.md +3 -3
  3. main.py +22 -0
  4. requirements.txt +5 -0
Dockerfile ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
+ # you will also find guides on how best to write your Dockerfile
3
+
4
+ FROM python:3.9
5
+
6
+ WORKDIR /code
7
+
8
+ COPY ./requirements.txt /code/requirements.txt
9
+
10
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
11
+
12
+ COPY . .
13
+
14
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
15
+
16
+
README.md CHANGED
@@ -1,8 +1,8 @@
1
  ---
2
  title: Server
3
- emoji: 📚
4
- colorFrom: gray
5
- colorTo: blue
6
  sdk: docker
7
  pinned: false
8
  ---
 
1
  ---
2
  title: Server
3
+ emoji: 🔥
4
+ colorFrom: red
5
+ colorTo: gray
6
  sdk: docker
7
  pinned: false
8
  ---
main.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Importing flask module in the project is mandatory
2
+ # An object of Flask class is our WSGI application.
3
+ from flask import Flask
4
+
5
+ # Flask constructor takes the name of
6
+ # current module (__name__) as argument.
7
+ app = Flask(__name__)
8
+
9
+ # The route() function of the Flask class is a decorator,
10
+ # which tells the application which URL should call
11
+ # the associated function.
12
+ @app.route('/')
13
+ # ‘/’ URL is bound with hello_world() function.
14
+ def hello_world():
15
+ return 'Hello World'
16
+
17
+ # main driver function
18
+ if __name__ == '__main__':
19
+
20
+ # run() method of Flask class runs the application
21
+ # on the local development server.
22
+ app.run()
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ faster-whisper
2
+ langchain
3
+ huggingface
4
+ flask
5
+ gunicorn