File size: 2,135 Bytes
1e89980
 
1c28b7f
3ab6224
1e89980
 
6aaf41c
 
5405b9e
 
1e89980
 
3ab6224
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: Catub
emoji: 😻
colorFrom: red
colorTo: red
sdk: docker
pinned: true
short_description: Catuserbot Huggingface Deploy
thumbnail: >-
  https://cdn-uploads.huggingface.co/production/uploads/63f08acc6309c84d5f480a28/0xl6BKfapTg6hU9sEqhq-.jpeg
---

# Catuserbot 😻 - Huggingface Deploy
This guide walks you through deploying Catuserbot to a Huggingface Space and setting up a keep-alive service.

---

## πŸš€ Deploy the Space
- **Create an account** at [huggingface.co](https://huggingface.co).
- Duplicate [this Space](https://huggingface.co/spaces/vauth/catub?visibility=private&duplicate=true) _(Make sure you set the Visibility to **Private**, otherwise your data will be public!)_.
- Navigate to the **Files** tab.
- Modify the `config.py` file with your specific values.
- You are done with the setup! Let it load (you can check the logs to monitor the build process).

---

## πŸ”‘ Get Huggingface Access Token
To keep the bot alive, you need a token to access your private space.

- Go to your Huggingface **Profile Settings** > **Access Tokens**.
- Create a new token with **"read"** permission.
- Save this token somewhere safe for the next step.

---

## ⏰ Implement Keep-Alive Service
Hugging Face pauses free spaces after periods of inactivity. To prevent this, we use a cron job to ping the space.

- Create an account at [cron-job.org](https://cron-job.org).
- Create a **new cronjob** with the following preferences:
  - **Common Settings:**
    - **Title:** `<random-name>`
    - **URL:** `https://<your-hf-username>-<repo-name>.hf.space`
    - **Execution schedule:** `Every 15 minutes`

  - **Advanced Settings (Headers):**
    - **User-Agent:** `<random-user-agent>`
    - **Authorization:** `Bearer <your-hf-access-token>`
- Click **Save** and you are done! Your Catuserbot will now stay awake.

---

## πŸ’¬ Need Help?
If you run into any issues or have questions, our community is here to help! 

<a href="https://t.me/catuserbot_support">
  <img src="https://img.shields.io/badge/Telegram-Support%20Group-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white" alt="Telegram Support Group">
</a>