Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
IliaLarchenko
commited on
Commit
•
83031e2
1
Parent(s):
2d989a9
Added docker
Browse files- Dockerfile +18 -0
- docker-compose.yml +10 -0
- docs/instruction.py +43 -30
Dockerfile
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official Python runtime as a parent image
|
2 |
+
FROM python:3.10-slim
|
3 |
+
|
4 |
+
# Set the working directory in the container to /app
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Copy the local directory contents into the container
|
8 |
+
COPY . .
|
9 |
+
|
10 |
+
# Install Python dependencies
|
11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
+
|
13 |
+
# Expose port 7860 to access the app
|
14 |
+
EXPOSE 7860
|
15 |
+
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
16 |
+
|
17 |
+
# Command to run the application
|
18 |
+
CMD ["python", "app.py"]
|
docker-compose.yml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: '3.8'
|
2 |
+
services:
|
3 |
+
interviewer:
|
4 |
+
build: .
|
5 |
+
ports:
|
6 |
+
- "7860:7860"
|
7 |
+
volumes:
|
8 |
+
- .:/app
|
9 |
+
env_file:
|
10 |
+
- .env
|
docs/instruction.py
CHANGED
@@ -30,70 +30,83 @@ Check out the other sections for instructions on how to set up the tool, use the
|
|
30 |
|
31 |
""",
|
32 |
"quick_start": """
|
33 |
-
#
|
34 |
|
35 |
-
|
36 |
|
37 |
-
##
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
## Clone the Repository
|
42 |
|
43 |
First, clone the project repository to your local machine using the following command in your terminal:
|
44 |
|
45 |
```bash
|
46 |
git clone https://huggingface.co/spaces/IliaLarchenko/interviewer
|
|
|
47 |
```
|
48 |
|
49 |
-
|
50 |
|
51 |
-
Create a
|
52 |
|
53 |
```bash
|
54 |
-
|
55 |
-
|
56 |
-
source venv/bin/activate
|
57 |
```
|
58 |
|
59 |
-
|
60 |
|
61 |
-
|
62 |
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
|
67 |
-
|
68 |
|
69 |
-
|
70 |
|
71 |
```bash
|
72 |
-
|
73 |
-
|
74 |
```
|
75 |
|
76 |
-
|
|
|
|
|
77 |
|
78 |
-
|
79 |
|
80 |
-
|
81 |
|
82 |
-
|
83 |
|
84 |
-
|
85 |
|
86 |
-
|
87 |
|
88 |
```bash
|
89 |
-
python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
```
|
91 |
|
92 |
-
|
|
|
|
|
93 |
|
94 |
-
|
|
|
|
|
95 |
|
96 |
-
|
97 |
""",
|
98 |
"interface": """
|
99 |
# Interview Interface Overview
|
|
|
30 |
|
31 |
""",
|
32 |
"quick_start": """
|
33 |
+
# Running the AI Tech Interviewer Simulator
|
34 |
|
35 |
+
This guide provides detailed instructions for setting up and running the AI Tech Interviewer Simulator either using Docker (recommended for simplicity) or running it locally.
|
36 |
|
37 |
+
## Initial Setup
|
38 |
|
39 |
+
### Clone the Repository
|
|
|
|
|
40 |
|
41 |
First, clone the project repository to your local machine using the following command in your terminal:
|
42 |
|
43 |
```bash
|
44 |
git clone https://huggingface.co/spaces/IliaLarchenko/interviewer
|
45 |
+
cd interviewer
|
46 |
```
|
47 |
|
48 |
+
### Configure the Environment
|
49 |
|
50 |
+
Create a `.env` file from the provided example and edit it to include your OpenAI API key:
|
51 |
|
52 |
```bash
|
53 |
+
cp .env.openai.example .env
|
54 |
+
nano .env # You can use any other text editor
|
|
|
55 |
```
|
56 |
|
57 |
+
Replace `OPENAI_API_KEY` in the `.env` file with your actual OpenAI API key.
|
58 |
|
59 |
+
## Option 1: Running with Docker
|
60 |
|
61 |
+
### Prerequisites
|
62 |
+
|
63 |
+
- Ensure **Docker** and **Docker Compose** are installed on your system. Download and install them from Docker's [official site](https://www.docker.com/get-started).
|
64 |
|
65 |
+
### Build and Run the Docker Container
|
66 |
|
67 |
+
Build and start the Docker container using the following commands:
|
68 |
|
69 |
```bash
|
70 |
+
docker-compose build
|
71 |
+
docker-compose up
|
72 |
```
|
73 |
|
74 |
+
### Access the Application
|
75 |
+
|
76 |
+
The application will be accessible at `http://localhost:7860`. Open this URL in your browser to start using the AI Tech Interviewer Simulator.
|
77 |
|
78 |
+
## Option 2: Running Locally
|
79 |
|
80 |
+
### Prerequisites
|
81 |
|
82 |
+
- Ensure you have **Python** installed on your system. Download and install it from [python.org](https://www.python.org).
|
83 |
|
84 |
+
### Set Up the Python Environment
|
85 |
|
86 |
+
Create a virtual environment to isolate the package dependencies:
|
87 |
|
88 |
```bash
|
89 |
+
python -m venv venv
|
90 |
+
source venv/bin/activate
|
91 |
+
```
|
92 |
+
|
93 |
+
### Install Dependencies
|
94 |
+
|
95 |
+
Install the required Python packages within the virtual environment:
|
96 |
+
|
97 |
+
```bash
|
98 |
+
pip install -r requirements.txt
|
99 |
```
|
100 |
|
101 |
+
### Running the Application
|
102 |
+
|
103 |
+
Start the server by executing:
|
104 |
|
105 |
+
```bash
|
106 |
+
python app.py
|
107 |
+
```
|
108 |
|
109 |
+
The application should now be accessible locally, typically at `http://localhost:7860`. Check your terminal output to confirm the URL.
|
110 |
""",
|
111 |
"interface": """
|
112 |
# Interview Interface Overview
|