Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Seraph19asfaw authored Nov 1, 2024
0 parents commit b79086e
Show file tree
Hide file tree
Showing 26 changed files with 1,257 additions and 0 deletions.
203 changes: 203 additions & 0 deletions .bash_history
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
pkg update
pkg upgrade
pkg install python
pkg install git
pkg search <transformer>
pkg search transformer
pkg search <transformers>
pkg search transformers
pkg install transformers
pip install transformers
pip --version
pkg install python-pip
pip install python-telegram-bot requests
python-telegram-bot==13.7
requests
python-telegram-bot==13.7
requests==2.26.0
web3==5.25.0 # If you need blockchain integration (for Ethereum-based tokens)
import sagemaker
import boto3
from sagemaker.huggingface import HuggingFaceModel
try:
role = sagemaker.get_execution_role()
except ValueError:
iam = boto3.client('iam')
role = iam.get_role(RoleName='sagemaker_execution_role')['Role']['Arn']
# Hub Model configuration. https://huggingface.co/models
hub = {
'HF_MODEL_ID':'Seraph19/Suea',
'HF_TASK':'text2text-generation'
}
# create Hugging Face Model Class
huggingface_model = HuggingFaceModel(
transformers_version='4.37.0',
pytorch_version='2.1.0',
py_version='py310',
env=hub,
role=role,
)
# deploy model to SageMaker Inference
predictor = huggingface_model.deploy(
initial_instance_count=1, # number of instances
instance_type='ml.m5.xlarge' # ec2 instance type
)
predictor.predict({
"inputs": "The answer to the universe is",
})
import sagemaker
import boto3
from sagemaker.huggingface import HuggingFaceModel
try:
role = sagemaker.get_execution_role()
except ValueError:
iam = boto3.client('iam')
role = iam.get_role(RoleName='sagemaker_execution_role')['Role']['Arn']
# Hub Model configuration. https://huggingface.co/models
hub = {
'HF_MODEL_ID':'Seraph19/Suea',
'HF_TASK':'text2text-generation'
}
# create Hugging Face Model Class
huggingface_model = HuggingFaceModel(
transformers_version='4.37.0',
pytorch_version='2.1.0',
py_version='py310',
env=hub,
role=role,
)
# deploy model to SageMaker Inference
predictor = huggingface_model.deploy(
initial_instance_count=1, # number of instances
instance_type='ml.m5.xlarge' # ec2 instance type
)
predictor.predict({
"inputs": "The answer to the universe is",
})
git clone https://huggingface.co/spaces/Seraph19/Santim
<iframe
src="https://seraph19-santim.hf.space"
frameborder="0"
width="850"
height="450"
></iframe>
git clone https://github.com/seraph19asfaw/python-telegram-bot-flask-example.git
cd python-telegram-bot-flask-example
github.com/seraph19asfaw
https://github.com/huggingface/autotrain-advanced.git
git clone https://huggingface.co/spaces/Seraph19/Santim
https://github.com/huggingface/autotrain-advanced.git
pip install autotrain-advanced
conda create -n autotrain python=3.10
conda activate autotrain
pip install autotrain-advanced
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
conda install -c "nvidia/label/cuda-12.1.0" cuda-nvcc
autotrain app --port 8080 --host 127.0.0.1
autotrain --config <path_to_config_file>
{ pkgs }: {; deps = [; pkgs.python39; pkgs.python39Packages.requests; pkgs.python39Packages.python-telegram-bot; ]; }
TELEGRAM_TOKEN = '7394516855:AAHiH9HlCmBTzyRBHN06vVYNWlxY1qZEgco'
TELEGRAM_TOKEN = ' 7322594950:AAFS4FOOYCdDnJy6VZUM4-6T86_mA18pxjQ '
su -
pkg_add -z git gperf php-7.2.10 cmake
exit
git clone [email protected]:spaces/Seraph19/Santim
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/token', methods=['POST'])
def distribute_token():
if __name__ == '__main__':; app.run(host='0.0.0.0', port=7860)
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/token', methods=['POST'])
def distribute_token():
if __name__ == '__main__':; app.run(host='0.0.0.0', port=7860)
curl -X POST https://seraph19-santim.hf.space/token -H "Content-Type: application/json" -d '{"user_id": 123456, "amount": 10}'
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/token', methods=['POST'])
def distribute_token():
if __name__ == '__main__':; app.run(host='0.0.0.0', port=7860)
Flask==2.0.2
curl -X POST https://seraph19-santim.hf.space/token -H "Content-Type: application/json" -d '{"user_id": "12345", "amount": 10}'
pkg install python
pip install python-telegram-bot requests
python bot.py
# Install vLLM from pip:
pip install vllm
# Load and run the model:
vllm serve "Seraph19/Suea"
# Call the server using curl:
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Seraph19/Suea"
"messages": [
{"role": "user", "content": "Hello!"}
]
}'
git clone https://huggingface.co/spaces/BLACKHOST/TelegramBot
import streamlit as st
x = st.slider('Select a value')
st.write(x, 'squared is', x * x)
git clone [email protected]:Seraph19/Suea
GIT_LFS_SKIP_SMUDGE=1 git clone [email protected]:Seraph19/Suea
ssh-keygen -t ed25519 -C "[email protected]"
$ ssh-add ~/.ssh/id_ed25519
git clone https://huggingface.co/Seraph19/Suea
ssh-keygen -t rsa -b 4096 -C "seraph19asfaw"
pbcopy < ~/.ssh/id_rsa.pub
```
pbcopy < ~/.ssh/id_rsa.pub
```
commannd objcopy in package binutils
pbcopy < ~/.ssh/id_rsa
objcopy in pkg binutils
pkg binutils
pkg install binutils
pbcopy < ~/.ssh/id_rsa
objcopy in binutils
ssh-add ~/.ssh/id_ed25519
ssh-keygen -t rsa -b 4096 -C "[email protected]"
save file
copy
objcopy
[email protected]:seraph19/my-repo.git
id_ed25519.pub
ssh-keygen -t ed25519 -C
ssh-keygen -t ed25519 -C"[email protected]"
ssh-add ~/.ssh/id_ed25519
ssh -T [email protected]

cat ~/.ssh/id_rsa.pub
git clone https://huggingface.co/Seraph19/Suea
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/Seraph19/Suea
git clone [email protected]:Seraph19/Suea
git clone [email protected]:spaces/levandong/MNIST-detect-deploy-webapp
git clone [email protected]:spaces/onekq-ai/WebApp1K-models-leaderboard
GIT_LFS_SKIP_SMUDGE=1 git clone [email protected]:Gameselo/STS-multilingual-mpnet-base-v2
git clone [email protected]:spaces/librarian-bots/huggingface-datasets-semantic-search
git clone [email protected]:RichardErkhov/PotatoOff_-_HamSter-0.2-gguf
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text2text-generation", model="Seraph19/Suea")
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("Seraph19/Suea")
import requests
API_URL = "https://api-inference.huggingface.co/models/cardiffnlp/twitter-roberta-base-sentiment-latest"
headers = {"Authorization": "Bearer hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
payload = {
}
response = requests.post(API_URL, headers=headers, json=payload)
response.json() import gradio as gr
gr.load("models/cardiffnlp/twitter-roberta-base-sentiment-latest").launch()
import gradio as gr
gr.load("models/cardiffnlp/twitter-roberta-base-sentiment-latest").launch()
<script
type="module"
src="https://gradio.s3-us-west-2.amazonaws.com/4.36.1/gradio.js"
></script>
<gradio-app src="https://seraph19-cardiffnlp-twitter-roberta-base-sentime-c90bcaf.hf.space"></gradio-app>
git clone https://huggingface.co/spaces/Seraph19/cardiffnlp-twitter-roberta-base-sentiment-latest
git clone https://huggingface.co/spaces/huggingface-projects/llama-3.2-3B-Instruct
3 changes: 3 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[user]
email = [email protected]
name = Your Name
71 changes: 71 additions & 0 deletions .github/workflows/apisec-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 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.

# APIsec addresses the critical need to secure APIs before they reach production.
# APIsec provides the industry’s only automated and continuous API testing platform that uncovers security vulnerabilities and logic flaws in APIs.
# Clients rely on APIsec to evaluate every update and release, ensuring that no APIs go to production with vulnerabilities.

# How to Get Started with APIsec.ai
# 1. Schedule a demo at https://www.apisec.ai/request-a-demo .
#
# 2. Register your account at https://cloud.apisec.ai/#/signup .
#
# 3. Register your API . See the video (https://www.youtube.com/watch?v=MK3Xo9Dbvac) to get up and running with APIsec quickly.
#
# 4. Get GitHub Actions scan attributes from APIsec Project -> Configurations -> Integrations -> CI-CD -> GitHub Actions
#
# apisec-run-scan
#
# This action triggers the on-demand scans for projects registered in APIsec.
# If your GitHub account allows code scanning alerts, you can then upload the sarif file generated by this action to show the scan findings.
# Else you can view the scan results from the project home page in APIsec Platform.
# The link to view the scan results is also displayed on the console on successful completion of action.

# This is a starter workflow to help you get started with APIsec-Scan Actions

name: APIsec

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
# Customize trigger events based on your DevSecOps processes.
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '42 11 * * 2'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:


permissions:
contents: read

jobs:

Trigger_APIsec_scan:
permissions:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
runs-on: ubuntu-latest

steps:
- name: APIsec scan
uses: apisec-inc/apisec-run-scan@025432089674a28ba8fb55f8ab06c10215e772ea
with:
# The APIsec username with which the scans will be executed
apisec-username: ${{ secrets.apisec_username }}
# The Password of the APIsec user with which the scans will be executed
apisec-password: ${{ secrets.apisec_password}}
# The name of the project for security scan
apisec-project: "VAmPI"
# The name of the sarif format result file The file is written only if this property is provided.
sarif-result-file: "apisec-results.sarif"
- name: Import results
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ./apisec-results.sarif
78 changes: 78 additions & 0 deletions .github/workflows/azure-webapps-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# This workflow will build and push a node.js application to an Azure Web App when a commit is pushed to your default branch.
#
# This workflow assumes you have already created the target Azure App Service web app.
# For instructions see https://docs.microsoft.com/en-us/azure/app-service/quickstart-nodejs?tabs=linux&pivots=development-environment-cli
#
# To configure this workflow:
#
# 1. Download the Publish Profile for your Azure Web App. You can download this file from the Overview page of your Web App in the Azure Portal.
# For more information: https://docs.microsoft.com/en-us/azure/app-service/deploy-github-actions?tabs=applevel#generate-deployment-credentials
#
# 2. Create a secret in your repository named AZURE_WEBAPP_PUBLISH_PROFILE, paste the publish profile contents as the value of the secret.
# For instructions on obtaining the publish profile see: https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the-github-secret
#
# 3. Change the value for the AZURE_WEBAPP_NAME. Optionally, change the AZURE_WEBAPP_PACKAGE_PATH and NODE_VERSION environment variables below.
#
# For more information on GitHub Actions for Azure: https://github.com/Azure/Actions
# For more information on the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# For more samples to get started with GitHub Action workflows to deploy to Azure: https://github.com/Azure/actions-workflow-samples

on:
push:
branches: [ "main" ]
workflow_dispatch:

env:
AZURE_WEBAPP_NAME: your-app-name # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
NODE_VERSION: '20.x' # set this to the node version to use

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm run test --if-present
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: node-app
path: .

deploy:
permissions:
contents: none
runs-on: ubuntu-latest
needs: build
environment:
name: 'Development'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: node-app

- name: 'Deploy to Azure WebApp'
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
Loading

0 comments on commit b79086e

Please sign in to comment.