From 483b4a3b0337b196454338af373929804f541716 Mon Sep 17 00:00:00 2001 From: Phani-kp Date: Tue, 28 Jan 2025 17:02:01 -0600 Subject: [PATCH 1/5] Create python-publish.yml --- .github/workflows/python-publish.yml | 70 ++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..82f8dbd --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,70 @@ +# This workflow will upload a Python Package to PyPI when a release is created +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + release-build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Build release distributions + run: | + # NOTE: put your own distribution build steps here. + python -m pip install build + python -m build + + - name: Upload distributions + uses: actions/upload-artifact@v4 + with: + name: release-dists + path: dist/ + + pypi-publish: + runs-on: ubuntu-latest + needs: + - release-build + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + + # Dedicated environments with protections for publishing are strongly recommended. + # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules + environment: + name: pypi + # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status: + # url: https://pypi.org/p/YOURPROJECT + # + # ALTERNATIVE: if your GitHub Release name is the PyPI project version string + # ALTERNATIVE: exactly, uncomment the following line instead: + # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }} + + steps: + - name: Retrieve release distributions + uses: actions/download-artifact@v4 + with: + name: release-dists + path: dist/ + + - name: Publish release distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: dist/ From ae27c2cd96044dfcf1adad9e283fbddcce202a04 Mon Sep 17 00:00:00 2001 From: Phani-kp Date: Wed, 29 Jan 2025 16:49:18 -0600 Subject: [PATCH 2/5] Rename DS-1000.png to DS.png --- pictures/{DS-1000.png => DS.png} | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename pictures/{DS-1000.png => DS.png} (100%) diff --git a/pictures/DS-1000.png b/pictures/DS.png similarity index 100% rename from pictures/DS-1000.png rename to pictures/DS.png From dd2f5c83d060540abe0d63b603ebcaaa5c65855c Mon Sep 17 00:00:00 2001 From: Phani-kp Date: Fri, 21 Feb 2025 22:31:12 -0600 Subject: [PATCH 3/5] Update app.py --- demo/app.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/demo/app.py b/demo/app.py index 1580e83..21a3a60 100644 --- a/demo/app.py +++ b/demo/app.py @@ -21,13 +21,11 @@ if not torch.cuda.is_available(): DESCRIPTION += "\n

Running on CPU 🥶 This demo does not work on CPU.

" - if torch.cuda.is_available(): model_id = "deepseek-ai/deepseek-coder-6.7b-instruct" model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto") tokenizer = AutoTokenizer.from_pretrained(model_id) tokenizer.use_default_system_prompt = False - @spaces.GPU @@ -56,11 +54,12 @@ def generate( streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True) generate_kwargs = dict( - {"input_ids": input_ids}, + input_ids=input_ids, streamer=streamer, max_new_tokens=max_new_tokens, - do_sample=False, - num_beams=1, + temperature=temperature, + top_p=top_p, + top_k=top_k, repetition_penalty=repetition_penalty, eos_token_id=tokenizer.eos_token_id ) @@ -70,7 +69,7 @@ def generate( outputs = [] for text in streamer: outputs.append(text) - yield "".join(outputs).replace("<|EOT|>","") + yield "".join(outputs).replace("<|EOT|>", "") chat_interface = gr.ChatInterface( @@ -84,13 +83,13 @@ def generate( step=1, value=DEFAULT_MAX_NEW_TOKENS, ), - # gr.Slider( - # label="Temperature", - # minimum=0, - # maximum=4.0, - # step=0.1, - # value=0, - # ), + gr.Slider( + label="Temperature", + minimum=0, + maximum=4.0, + step=0.1, + value=0.6, + ), gr.Slider( label="Top-p (nucleus sampling)", minimum=0.05, From e22ec2a33b07c200dd69f1044d6c0f97943b4240 Mon Sep 17 00:00:00 2001 From: Phani-kp Date: Fri, 21 Feb 2025 22:32:39 -0600 Subject: [PATCH 4/5] Update eval_instruct.py From 0f0b1cc80262304f6c6128cb73c4fe33d611d05a Mon Sep 17 00:00:00 2001 From: Phani-kp Date: Sat, 1 Mar 2025 06:28:50 -0600 Subject: [PATCH 5/5] Create django.yml --- .github/workflows/django.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/django.yml diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml new file mode 100644 index 0000000..9766b45 --- /dev/null +++ b/.github/workflows/django.yml @@ -0,0 +1,30 @@ +name: Django CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: [3.7, 3.8, 3.9] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Run Tests + run: | + python manage.py test