lint commited on
Commit
1946d35
·
1 Parent(s): 6dd0f82

Upload folder using huggingface_hub

Browse files
Files changed (5) hide show
  1. Dockerfile +23 -0
  2. __pycache__/gradify.cpython-310.pyc +0 -0
  3. demo.yaml +28 -0
  4. gradify.py +34 -0
  5. requirements.txt +2 -0
Dockerfile ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10
2
+
3
+ WORKDIR /code
4
+
5
+ COPY ./requirements.txt /code/requirements.txt
6
+
7
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
+
9
+ # Set up a new user named "user" with user ID 1000
10
+ RUN useradd -m -u 1000 user
11
+ # Switch to the "user" user
12
+ USER user
13
+ # Set home to the user's home directory
14
+ ENV HOME=/home/user \
15
+ PATH=/home/user/.local/bin:$PATH
16
+
17
+ # Set the working directory to the user's home directory
18
+ WORKDIR $HOME/app
19
+
20
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
21
+ COPY --chown=user . $HOME/app
22
+
23
+ CMD ["lite", "demo.yaml", "launch", "--server_name", "0.0.0.0", "--server_port", "7860"]
__pycache__/gradify.cpython-310.pyc ADDED
Binary file (1.06 kB). View file
 
demo.yaml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ lite_metadata:
2
+ gradio_version: 3.32.0
3
+ liteobj_version: 0.0.7
4
+ class_string: gradio.interface.Interface
5
+ kwargs:
6
+ title: Gradio Webapp
7
+ description: Transcribe a recording of a meeting into a text summary
8
+ article: null
9
+ thumbnail: null
10
+ theme: gradio/seafoam
11
+ css: null
12
+ allow_flagging: never
13
+ inputs:
14
+ - class_string: gradio.components.Textbox
15
+ kwargs:
16
+ label: recording
17
+ outputs:
18
+ - class_string: gradio.components.Textbox
19
+ kwargs:
20
+ label: output
21
+ fn:
22
+ class_string: gradify.gradify_closure
23
+ kwargs:
24
+ argmaps:
25
+ - label: recording
26
+ postprocessing: null
27
+ func_kwargs: {}
28
+ source: "def transcribe_meeting(recording):\n return summary\n"
gradify.py ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ def gradify_closure(source, argmaps, func_kwargs={}):
4
+
5
+ ldict = {}
6
+ exec(source, globals(), ldict)
7
+
8
+ from types import FunctionType
9
+ for k, v in ldict.items():
10
+ if isinstance(v, FunctionType):
11
+ func = ldict.pop(k)
12
+ break
13
+
14
+ globals().update(ldict)
15
+ func_kwargs = dict(func_kwargs)
16
+
17
+ def gradify_func(*args):
18
+
19
+ try:
20
+ for (arg, argmap) in zip(args, argmaps):
21
+
22
+ postprocessing = argmap.get("postprocessing", None)
23
+ if postprocessing:
24
+ arg = eval(postprocessing)(arg)
25
+
26
+ kw_label = argmap["label"]
27
+ func_kwargs[kw_label] = arg
28
+
29
+ return func(**func_kwargs)
30
+ except Exception as e:
31
+ import gradio as gr
32
+ raise gr.Error(f"Error: {e}")
33
+
34
+ return gradify_func
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ gradio==3.32
2
+ liteobj==0.0.7