Kashyap2512 commited on
Commit
57768f6
1 Parent(s): 08af206

Delete llm_app

Browse files
Files changed (3) hide show
  1. llm_app/Dockerfile +0 -28
  2. llm_app/app.py +0 -23
  3. llm_app/requirements.txt +0 -6
llm_app/Dockerfile DELETED
@@ -1,28 +0,0 @@
1
- FROM ubuntu:18.04
2
-
3
- RUN apt-get --fix-missing -y update && apt-get install -y --no-install-recommends \
4
- wget \
5
- python3.8 \
6
- python3-pip \
7
- nginx \
8
- ca-certificates \
9
- && rm -rf /var/lib/apt/lists/*
10
-
11
- RUN ln -s /usr/bin/python3.9 /usr/bin/python
12
-
13
- RUN python -m pip install --upgrade pip setuptools wheel
14
-
15
- RUN apt-get update && apt-get install libgomp1
16
-
17
-
18
-
19
- COPY ./llm_app ./llm_app
20
-
21
- WORKDIR /llm_app
22
-
23
- RUN pip install -r requirements.txt
24
-
25
-
26
- CMD ["uvicorn", "app:app","--host","0.0.0.0","--port","7860"]
27
-
28
- RUN rm -rf /var/cache
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
llm_app/app.py DELETED
@@ -1,23 +0,0 @@
1
- from fastapi import FastAPI
2
- from transformers import pipeline
3
- # print("Package Load Successfully")
4
-
5
- ### create a FastAPI app instance
6
- app = FastAPI()
7
-
8
- ## Initialize the Text Generation pipeline
9
- pipe = pipeline("text2text-generation", model="google/flan-t5-small")
10
-
11
- ### Define the Route
12
-
13
- @app.get('/')
14
- def home():
15
- return ({"message":"Hello world"})
16
-
17
- @app.get('/generate')
18
- def generate(text:str):
19
- ## use the pipeline to generate the text generation
20
- output=pipe(text)
21
- ## return the output generated text in json format
22
- return {"output":output[0]["generated_text"]}
23
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
llm_app/requirements.txt DELETED
@@ -1,6 +0,0 @@
1
- fastapi
2
- requests
3
- uvicorn[standard]
4
- sentencepiece
5
- torch
6
- transformers