Skip to content

Instantly share code, notes, and snippets.

View peterdavidfagan's full-sized avatar

Peter David Fagan peterdavidfagan

View GitHub Profile
@jrknox1977
jrknox1977 / ollama_dspy.py
Created February 9, 2024 18:06
ollama+DSPy using OpenAI APIs.
# install DSPy: pip install dspy
import dspy
# Ollam is now compatible with OpenAI APIs
#
# To get this to work you must include `model_type='chat'` in the `dspy.OpenAI` call.
# If you do not include this you will get an error.
#
# I have also found that `stop='\n\n'` is required to get the model to stop generating text after the ansewr is complete.
# At least with mistral.
@zkytony
zkytony / message_filter_minimum.py
Last active October 12, 2023 14:32
Minimum Python example of using ROS2 message_filter with latching
# Using ROS Humble
# /author: Kaiyu Zheng
import rclpy
import message_filters
import geometry_msgs.msg
import std_msgs.msg
from rclpy.node import Node
from rclpy.qos import QoSProfile, QoSDurabilityPolicy