Dhruv11 commited on
Commit
552cdcc
1 Parent(s): fa9807f

Upload 3 files

Browse files
Files changed (3) hide show
  1. Dockerfile +21 -0
  2. app.py +15 -0
  3. requirements.txt +1 -0
Dockerfile ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Copy requirements and install Python dependencies
11
+ COPY requirements.txt .
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ # Copy the application code
15
+ COPY app.py .
16
+
17
+ # Hugging Face Spaces uses port 7860 by default
18
+ EXPOSE 8000
19
+
20
+ # Set the command to run the app
21
+ CMD ["python", "-m", "gradio", "app.py"]
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+
4
+ def celsius_to_fahrenheit(celsius):
5
+ return celsius * 9/5 + 32
6
+
7
+ demo = gr.Interface(
8
+ fn=celsius_to_fahrenheit,
9
+ inputs=gr.Number(label="Temperature in Celsius"),
10
+ outputs=gr.Number(label="Temperature in Fahrenheit"),
11
+ title="Celsius to Fahrenheit Converter"
12
+ )
13
+
14
+ if __name__ == "__main__":
15
+ demo.launch()
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ gradio