File size: 3,175 Bytes
9f33690
8095b8a
9f33690
 
 
 
 
 
 
8095b8a
9f33690
 
74b66c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b374d39
74b66c1
 
b374d39
74b66c1
b374d39
74b66c1
b374d39
74b66c1
d79eb5f
74b66c1
 
 
d79eb5f
 
 
 
 
 
 
 
 
 
74b66c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d79eb5f
74b66c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b374d39
74b66c1
 
b374d39
 
 
 
 
74b66c1
b374d39
d79eb5f
74b66c1
 
 
d79eb5f
 
 
 
 
 
 
 
 
74b66c1
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
---
title: Gaia Chat
emoji: 💬
colorFrom: yellow
colorTo: purple
sdk: gradio
sdk_version: 5.0.1
app_file: app.py
pinned: false
license: mit
---

### Choisir la langue : [Français](#français) | [English](#english)

## Français

<a name="français"></a>

## Description

Gaia Chat est un exemple de chatbot utilisant [Gradio](https://gradio.app), [`huggingface_hub`](https://huggingface.co/docs/huggingface_hub/v0.22.2/en/index), et l'[API d'inférence de Hugging Face](https://huggingface.co/docs/api-inference/index). Ce projet montre comment créer un chatbot interactif en utilisant ces outils.

## Prérequis

- Python 3.6 ou supérieur

## Installation

### 1. Installer Python

Assurez-vous que Python est installé. 

1. Rendez-vous sur le site officiel de Python : [https://www.python.org/downloads/](https://www.python.org/downloads/)
2. Vérifiez l’installation avec la commande :
   ```sh
   python --version
   ```



### 2. Installer les dépendances

Installez les dependances :

```sh
python -m venv .venv

source .venv/bin/activate

pip install -r requirements.txt
```
### 4. Gener un Access token sur Hugging Face

Rendez-vous sur votre profil Hugging Face pour genenez votre Access Token : [https://huggingface.co/settings/tokens](https://huggingface.co/settings/tokens)


### 5. Créer et configurer le fichier `.env`

1. Créer le fichier `.env` :  
   ```sh
   echo HFTOKEN="votre_token_ici" > .env
   ```
2. Ajouter le token que vous avez créé précédemment dans votre fichier `.env`.

### 6. Lancer l'application

Exécutez la commande suivante pour démarrer Gaia Chat :

```sh
python app.py
```

Une fois l'application lancée, ouvrez votre navigateur et accédez à l'URL indiquée dans le terminal pour interagir avec le chatbot.


---


## English

<a name="english"></a>


## Description

Gaia Chat is an example chatbot using [Gradio](https://gradio.app), [`huggingface_hub`](https://huggingface.co/docs/huggingface_hub/v0.22.2/en/index), and l '[Hugging Face Inference API](https://huggingface.co/docs/api-inference/index). This project shows how to create an interactive chatbot using these tools.


## Prerequisites

- Python 3.6

## Facilities

### 1. Python install

Make sure Python is installed.

1. Go to the official Python website: [https://www.python.org/downloads/](https://www.python.org/downloads/)
2. Verify the installation with the command:
```sh
   python --version
```

### 2. Install dependencies

Install :

```sh
python -m venv .venv

source .venv/bin/activate

pip install -r requirements.txt
```

### 4. Generate Access Token on Hugging Face

Go to your Hugging Face profile to generate your access token: [https://huggingface.co/settings/tokens](https://huggingface.co/settings/tokens)

### 5. Create and configure the `.env` File  

1. Create the `.env` file:  
   ```sh
   echo HFTOKEN="your_token_here" > .env
   ```  
2. Add the token you created earlier to your `.env` file.

### 6. Launch the application

Run the following command to start Gaia Chat:

```sh
python app.py
```

Once the application is launched, open your browser and navigate to the URL given in the terminal to interact with the chatbot.