Skip to content

Instantly share code, notes, and snippets.

View bsamadi's full-sized avatar

Behzad Samadi bsamadi

View GitHub Profile
@bsamadi
bsamadi / *DeepSeek-uncensored.md
Created February 2, 2025 15:52 — forked from ruvnet/*DeepSeek-uncensored.md
Deploying and Fine-Tuning an Uncensored DeepSeek R1 Distill Model on Google Cloud

DeepSeek R1 Distill: Complete Tutorial for Deployment & Fine-Tuning

This guide shows how to deploy an uncensored DeepSeek R1 Distill model to Google Cloud Run with GPU support and how to perform a basic, functional fine-tuning process. The tutorial is split into:

  1. Environment Setup
  2. FastAPI Inference Server
  3. Docker Configuration
  4. Google Cloud Run Deployment
  5. Fine-Tuning Pipeline (Cold Start, Reasoning RL, Data Collection, Final RL Phase)
@bsamadi
bsamadi / gist:90e7b3229026e6e27dfaabd4552a9b47
Created October 23, 2023 20:44
MAV_CMD_DO_MOUNT_CONTROL
from pymavlink import mavutil
# Set the connection string to your autopilot. This can be a serial port or a network connection.
connection_string = 'udp:127.0.0.1:5800' # Replace with the appropriate connection details
# Create a MAVLink connection
master = mavutil.mavlink_connection(connection_string)
while True:
msg = master.recv_match(type='COMMAND_LONG', blocking=True)
@bsamadi
bsamadi / LogitechF710.txt
Created April 21, 2023 21:42
Logitech F710 driver for Windows 11
This game pad has been around quite a while, so I thought I would try to use it on the latest version of Windows 11, here is what I found (08/01/2023).
Windows 11 doesn't recognise this device when you plug it in (no Plug'n'Play).
It will work quite well eventually, but I found I needed to do the following.
Before you start, make sure the F710 is in 'X' mode NOT 'D' mode (little switch on the front)
1. Download the Logitech F710 Connect Utility:
https://download01.logi.com/web/ftp/pub/techsupport/joystick/F710ConnectUtility_2.15.264.exe
2. Use this utility to get the F710 installed
@bsamadi
bsamadi / gist.md
Last active August 19, 2022 19:35
  • Role type: ML Tech Lead (non-people management) Work location: Remote
  • Position overview:
    • Play a critical role in shaping the strategy, defining metrics and counter-metrics, and setting goals and priorities for the team ML system design, ML excellence, and identify and develop need new metrics plan.
    • Lead projects and teams accordingly including develop custom/novel ML architectures.
    • Function as go-to person to escalate the most complex online / production performance and evaluation issues beyond modeling and how the machine learning system interacts with the other systems around it.
    • Re-evaluate the tradeoffs of already shipped features/ML systems and drive large efforts across multiple teams.
    • Significantly level up the quality of ML work in the broader team around you
    • Develop highly scalable classifiers and tools leveraging machine learning, data regression, and rules-based models.
    • Code deliverables in tandem with the engineering team
  • Adapt standard machine learning methods
@bsamadi
bsamadi / install-cuda.sh
Last active February 23, 2020 19:23
Install Cuda on Ubuntu 18.04
sudo apt update
sudo apt install nvidia-cuda-toolkit
ls /dev/nvidia*
nvcc -V
nvidia-smi
@bsamadi
bsamadi / odrv0-00.txt
Created December 16, 2019 05:27
The value of odrv0 version 00
vbus_voltage = 19.461620330810547 (float)
serial_number = 2060358F524B (int)
hw_version_major = 3 (int)
hw_version_minor = 6 (int)
hw_version_variant = 24 (int)
fw_version_major = 0 (int)
fw_version_minor = 4 (int)
fw_version_revision = 11 (int)
fw_version_unreleased = 0 (int)
user_config_loaded = False (bool)
@bsamadi
bsamadi / ODrive-error-on-Ubuntu-18.04-01.txt
Created December 16, 2019 05:16
ODrive error on Ubuntu 18.04 01
ODrive control utility v0.4.11
/usr/local/lib/python3.6/dist-packages/fibre/shell.py:104: RuntimeWarning: coroutine 'InteractiveShell.run_code' was never awaited
console.runcode('import sys')
/usr/local/lib/python3.6/dist-packages/fibre/shell.py:105: RuntimeWarning: coroutine 'InteractiveShell.run_code' was never awaited
console.runcode('superexcepthook = sys.excepthook')
/usr/local/lib/python3.6/dist-packages/fibre/shell.py:106: RuntimeWarning: coroutine 'InteractiveShell.run_code' was never awaited
console.runcode('def newexcepthook(ex_class,ex,trace):\n'
/usr/local/lib/python3.6/dist-packages/fibre/shell.py:109: RuntimeWarning: coroutine 'InteractiveShell.run_code' was never awaited
console.runcode('sys.excepthook=newexcepthook')
Please connect your ODrive.
@bsamadi
bsamadi / ODrive-error-on-Windows-01.txt
Created December 16, 2019 04:08
ODrive error on Windows #01
c:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\Scripts>odrivetool
Could not init terminal features.
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
c:\Users\nubon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\Scripts\odrivetool in <module>
13 os.path.realpath(__file__))),
14 "Firmware", "fibre", "python"))
---> 15 import fibre.discovery
16 from fibre import Logger, Event
17 import odrive
@bsamadi
bsamadi / ros_lawn_tractor_colcon.log
Created March 31, 2019 16:40
Errors in building ros_lawn_tractor using colcon
root@1c7a8baa9d20:/workspace# colcon build
[1.177s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/opt/ros/kinetic' in the environment variable CMAKE_PREFIX_PATH seems to be a catkin workspace but it doesn't contain any 'local_setup.*' files. Maybe the catkin version is not up-to-date?
Starting >>> lawn_tractor_navigation
Starting >>> geonav_transform
Starting >>> lawn_tractor_sim
Finished <<< lawn_tractor_sim [2.30s]
Finished <<< lawn_tractor_navigation [2.60s]
Starting >>> lawn_tractor
--- stderr: lawn_tractor
CMake Error at CMakeLists.txt:3 (find_package):