diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2024-02-13 16:36:24 +0000 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2024-02-13 16:36:24 +0000 |
commit | 12238c47081cd789c09e6677495cca3d31356cf1 (patch) | |
tree | f702377dfc4159b3752239c05eba2f7cc71071e5 | |
parent | 76963cdaad8b19335a8e13246313833cdaf758e6 (diff) | |
download | noetic-llama-12238c47081cd789c09e6677495cca3d31356cf1.tar.gz noetic-llama-12238c47081cd789c09e6677495cca3d31356cf1.zip |
Started on devcontainer stuff
-rw-r--r-- | Modelfile | 28 | ||||
-rw-r--r-- | noetic-llama/.devcontainer/Dockerfile | 30 | ||||
-rw-r--r-- | noetic-llama/.devcontainer/devcontainer.json | 55 | ||||
-rw-r--r-- | temp.py | 8 |
4 files changed, 121 insertions, 0 deletions
diff --git a/Modelfile b/Modelfile new file mode 100644 index 0000000..bc66595 --- /dev/null +++ b/Modelfile @@ -0,0 +1,28 @@ +FROM nexusraven:13b-v2-q3_K_S +SYSTEM """ +Function: +def get_weather_data(coordinates): + ''' + Fetches weather data from the Open-Meteo API for the given latitude and longitude. + + Args: + coordinates (tuple): The latitude of the location. + + Returns: + float: The current temperature in the coordinates you've asked for + ''' + +Function: +def get_coordinates_from_city(city_name): + ''' + Fetches the latitude and longitude of a given city name using the Maps.co Geocoding API. + + Args: + city_name (str): The name of the city. + + Returns: + tuple: The latitude and longitude of the city. + ''' + +User Query: {query}<human_end> +"""
\ No newline at end of file diff --git a/noetic-llama/.devcontainer/Dockerfile b/noetic-llama/.devcontainer/Dockerfile new file mode 100644 index 0000000..d86a5e7 --- /dev/null +++ b/noetic-llama/.devcontainer/Dockerfile @@ -0,0 +1,30 @@ +FROM osrf/ros:noetic-desktop-full + +# Add vscode user with same UID and GID as your host system +# (copied from https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user#_creating-a-nonroot-user) +ARG USERNAME=vscode +ARG USER_UID=1000 +ARG USER_GID=$USER_UID +RUN groupadd --gid $USER_GID $USERNAME \ + && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \ + && apt-get update \ + && apt-get install -y sudo \ + && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ + && chmod 0440 /etc/sudoers.d/$USERNAME +# Switch from root to user +USER $USERNAME + +# Add user to video group to allow access to webcam +RUN sudo usermod --append --groups video $USERNAME + +# Update all packages +RUN sudo apt update && sudo apt upgrade -y + +# Install Git +RUN sudo apt install -y git + +# Rosdep update +RUN rosdep update + +# Source the ROS setup file +RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc diff --git a/noetic-llama/.devcontainer/devcontainer.json b/noetic-llama/.devcontainer/devcontainer.json new file mode 100644 index 0000000..64a355a --- /dev/null +++ b/noetic-llama/.devcontainer/devcontainer.json @@ -0,0 +1,55 @@ +{ + "name": "noetic-llama devcontainer", + "dockerFile": "Dockerfile", + "runArgs": [ + "--privileged", + "--network=host", + "-v=/dev:/dev", + "--privileged", + "--runtime=nvidia", + "--device-cgroup-rule" "a *:* rmw", + "--cap-add=SYS_PTRACE", + "--security-opt=seccomp:unconfined", + "--security-opt=apparmor:unconfined", + "--volume=/tmp/.X11-unix:/tmp/.X11-unix", + "--volume=/home/agilex/.Xauthority:/home/ros/.Xauthority", + "--gpus=all" + ], + "containerEnv": { + "DISPLAY": ":0", + "LIBGL_ALWAYS_SOFTWARE": "1" // Needed for software rendering of opengl + }, + "workspaceMount": "source=${localWorkspaceFolder},target=/${localWorkspaceFolderBasename},type=bind", + "workspaceFolder": "/${localWorkspaceFolderBasename}", + "mounts": [ + "source=${localEnv:HOME}${localEnv:USERPROFILE}/.bash_history,target=/home/vscode/.bash_history,type=bind" + ], + "features": { + "ghcr.io/devcontainers/features/python:1": {} + }, + "customizations": { + "vscode": { + "extensions": [ + "dotjoshjohnson.xml", + "zachflower.uncrustify", + "ms-azuretools.vscode-docker", + "ms-iot.vscode-ros", + "ms-python.python", + "ms-vscode.cpptools", + "redhat.vscode-yaml", + "smilerobotics.urdf", + "streetsidesoftware.code-spell-checker", + "twxs.cmake", + "yzhang.markdown-all-in-one" + ] + }, + "settings": { + "terminal.integrated.profiles.linux": { + "bash": { + "path": "bash" + } + }, + "terminal.integrated.defaultProfile.linux": "bash" + } + } +} @@ -0,0 +1,8 @@ +import ollama + +with open("Modelfile", "r") as f: + ollama.create(model = "temp", modelfile= f.read()) + +print(ollama.generate(model='temp', prompt='What\'s the weather like right now in London?', options={"stop": ["\nThought:"]})) + +ollama.delete("temp")
\ No newline at end of file |