Skip to content
This repository was archived by the owner on Sep 18, 2024. It is now read-only.

Deploy on render.com #88

Merged
merged 25 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions subnet/miner-cloudflare/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3.10-slim

WORKDIR /code

COPY . /code
# COPY ./requirements.txt /code/requirements.txt
# COPY ./setup.py /code/setup.py

RUN python -m pip install -e .


CMD ["python", "main.py"]
2 changes: 1 addition & 1 deletion subnet/miner-cloudflare/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ async def chat(request: ChatRequest):

if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=os.getenv('PORT', 9000))
uvicorn.run(app, host="0.0.0.0", port=os.getenv('PORT', 8080))
1 change: 0 additions & 1 deletion subnet/miner-cloudflare/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
bittensor
torch
flask
pydantic
python-dotenv
simplejson
Expand Down
6 changes: 3 additions & 3 deletions subnet/miner-cloudflare/stream_miner.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, config=None, axon=None, wallet=None, subtensor=None):
self.miner_services = {
"type": 'cloudflare',
"models": ['llama-2-7b-chat-int8', 'mistral-7b-instruct-v0.1'],
"address": os.getenv('ADDRESS')
"MINER_ADDRESS": os.getenv('MINER_ADDRESS')
}

check_config(StreamMiner, self.config)
Expand Down Expand Up @@ -84,7 +84,7 @@ def __init__(self, config=None, axon=None, wallet=None, subtensor=None):

# TODO replace with hosted endpoint of service map
url = os.getenv('SERVICE_MESH_URL')
secret = os.getenv('SECRET_KEY')
secret = os.getenv('SERVICE_MESH_SECRET_KEY')
# for now miners are allow listed manually and given a secret key to identify
headers = {'Content-Type': 'application/json',
'Authorization': f'Bearer {secret}'}
Expand All @@ -104,7 +104,7 @@ def __init__(self, config=None, axon=None, wallet=None, subtensor=None):
else:
self.uuid = os.getenv('UUID') or uuid.uuid4()
url = os.getenv('SERVICE_MESH_URL')
secret = os.getenv('SECRET_KEY')
secret = os.getenv('SERVICE_MESH_SECRET_KEY')
# for now miners are allow listed manually and given a secret key to identify
headers = {'Content-Type': 'application/json',
'Authorization': f'Bearer {secret}'}
Expand Down
Loading