Greums commited on
Commit
cc53151
·
1 Parent(s): 06126dc

add instructions in readme

Browse files
Files changed (3) hide show
  1. README.md +27 -1
  2. app.py +1 -0
  3. requirements.txt +84 -0
README.md CHANGED
@@ -8,4 +8,30 @@ app_file: README.md
8
  pinned: false
9
  ---
10
 
11
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  pinned: false
9
  ---
10
 
11
+ ## How to use
12
+ ### 1. Create an account on [Beam](https://platform.beam.cloud/)
13
+ ### 2. Create a Python virtualenv and activate it
14
+ ```shell
15
+ python3 -m venv .venv && source .venv/bin/activate
16
+ ```
17
+ ### 3. Install required packages
18
+ ```shell
19
+ pip install -r requirements.txt
20
+ ```
21
+ ### 4. Register Beam API Token
22
+ Retrieve your API token from the dashboard, on the [API Keys](https://platform.beam.cloud/settings/api-keys) page.
23
+ ```shell
24
+ beam configure default --token [TOKEN]
25
+ ```
26
+ ### 5. Deploy on Beam
27
+ ```shell
28
+ beam deploy app.py:server
29
+ ```
30
+ ### 6. Call the stream endpoint
31
+ ```shell
32
+ curl -X POST 'https://[ID].app.beam.cloud/stream' \
33
+ -H 'Connection: keep-alive' \
34
+ -H 'Content-Type: application/json' \
35
+ -H 'Authorization: Bearer [TOKEN]' \
36
+ -d '{"prompt": "", "posts_count": 5}'
37
+ ```
app.py CHANGED
@@ -85,6 +85,7 @@ def stream(model: PreTrainedModel, tokenizer: PreTrainedTokenizerFast, body: Bod
85
 
86
 
87
  @asgi(
 
88
  on_start=load_models,
89
  cpu=2.0,
90
  memory="16Gi",
 
85
 
86
 
87
  @asgi(
88
+ name="jvcgpt",
89
  on_start=load_models,
90
  cpu=2.0,
91
  memory="16Gi",
requirements.txt ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ annotated-types==0.7.0
2
+ anyio==4.8.0
3
+ asgiref==3.8.1
4
+ bcrypt==4.2.1
5
+ beam-client==0.2.132
6
+ beta9==0.1.155
7
+ betterproto-beta9==2.0.0b7
8
+ black==24.10.0
9
+ certifi==2024.12.14
10
+ cffi==1.17.1
11
+ charset-normalizer==3.4.1
12
+ click==8.1.8
13
+ cloudpickle==3.1.1
14
+ croniter==3.0.4
15
+ cryptography==44.0.0
16
+ fastapi==0.110.3
17
+ filelock==3.17.0
18
+ fsspec==2024.12.0
19
+ grpcio==1.69.0
20
+ grpclib==0.4.7
21
+ h11==0.14.0
22
+ h2==4.1.0
23
+ hpack==4.1.0
24
+ huggingface-hub==0.27.1
25
+ hyperframe==6.1.0
26
+ idna==3.10
27
+ isort==5.13.2
28
+ Jinja2==3.1.5
29
+ markdown-it-py==3.0.0
30
+ MarkupSafe==3.0.2
31
+ mdurl==0.1.2
32
+ mpmath==1.3.0
33
+ multidict==6.1.0
34
+ mypy-extensions==1.0.0
35
+ networkx==3.4.2
36
+ numpy==2.2.2
37
+ nvidia-cublas-cu12==12.4.5.8
38
+ nvidia-cuda-cupti-cu12==12.4.127
39
+ nvidia-cuda-nvrtc-cu12==12.4.127
40
+ nvidia-cuda-runtime-cu12==12.4.127
41
+ nvidia-cudnn-cu12==9.1.0.70
42
+ nvidia-cufft-cu12==11.2.1.3
43
+ nvidia-curand-cu12==10.3.5.147
44
+ nvidia-cusolver-cu12==11.6.1.9
45
+ nvidia-cusparse-cu12==12.3.1.170
46
+ nvidia-nccl-cu12==2.21.5
47
+ nvidia-nvjitlink-cu12==12.4.127
48
+ nvidia-nvtx-cu12==12.4.127
49
+ packaging==24.2
50
+ paramiko==3.5.0
51
+ pathspec==0.12.1
52
+ platformdirs==4.3.6
53
+ prompt_toolkit==3.0.50
54
+ protobuf==4.25.6
55
+ pycparser==2.22
56
+ pydantic==2.10.6
57
+ pydantic_core==2.27.2
58
+ Pygments==2.19.1
59
+ PyNaCl==1.5.0
60
+ python-dateutil==2.9.0.post0
61
+ pytz==2024.2
62
+ PyYAML==6.0.2
63
+ regex==2024.11.6
64
+ requests==2.32.3
65
+ rich==13.9.4
66
+ safetensors==0.5.2
67
+ setuptools==75.8.0
68
+ six==1.17.0
69
+ sniffio==1.3.1
70
+ starlette==0.37.2
71
+ sympy==1.13.1
72
+ tokenizers==0.21.0
73
+ torch==2.5.1
74
+ tqdm==4.67.1
75
+ transformers==4.48.1
76
+ triton==3.1.0
77
+ typeguard==2.13.3
78
+ typing_extensions==4.12.2
79
+ urllib3==2.3.0
80
+ uvicorn==0.29.0
81
+ watchdog==4.0.2
82
+ wcwidth==0.2.13
83
+ websocket-client==1.8.0
84
+ websockets==12.0