This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You are an AI assistant designed to provide detailed, step-by-step responses. Your outputs should follow this structure: | |
1. Begin with a <thinking> section. | |
2. Inside the thinking section: | |
a. Briefly analyze the question and outline your approach. | |
b. Present a clear plan of steps to solve the problem. | |
c. Use a "Chain of Thought" reasoning process if necessary, breaking down your thought process into numbered steps. | |
3. Include a <reflection> section for each idea where you: | |
a. Review your reasoning. | |
b. Check for potential errors or oversights. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install -U git+https://github.com/huggingface/transformers.git | |
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM | |
import torch | |
import time | |
def chat_with_ai(model, tokenizer): | |
""" | |
Function to simulate chatting with the AI model via the command line. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_special_number(number): | |
if number == 7: | |
return True | |
elif number == 18: | |
return True | |
else: | |
return False | |
def is_special_number_2 (number): | |
return number in [7, 18] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sealed classes are abstract (can't be instatiated) and can only be | |
// implemented in the same library (library in Dart is one file be default) | |
sealed class Message { | |
} | |
class TextMessage implements Message { | |
final String content; | |
TextMessage(this.content); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://matplotlib.org/matplotblog/posts/animated-fractals/ | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
import time | |
x_start, y_start = -2, -2 # an interesting region starts here | |
width, height = 4, 4 # for 4 units up and right | |
density_per_unit = 80 # how many pixles per unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math'; | |
import 'dart:ui'; | |
import 'package:app/grpc_generated/client.dart'; | |
import 'package:app/grpc_generated/init_py.dart'; | |
import 'package:app/grpc_generated/init_py_native.dart'; | |
import 'package:app/grpc_generated/service.pbgrpc.dart'; | |
import 'package:flutter/material.dart'; | |
Future<void> pyInitResult = Future(() => null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dotenv from "dotenv"; | |
const API_KEY = process.env.API_KEY; | |
const API_ENDPOINT = process.env.API_ENDPOINT; // ?api-version=2023-07-01-preview is required as of August 2023 | |
const validate = async (name: string, project: string, role: string, category: string, feedback: string, summary: string): Promise<{ status: string, recommendations: string }> => { | |
var nominee = generateNomineeString(name, project, role, category, feedback, summary); | |
// Using function call capability of OpenAI API to ensure response is properly formatted JSON | |
// Before function calling I asked to reply via JSON, one of side effect was that in 'recomendations' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math'; | |
const String h = 'kjddHjblwoopwedlradljljlkdfefldlkfdog dgdfgdf'; | |
abstract class A { | |
String getMessage() => 'A'; | |
} | |
class B { | |
String getMessage() => 'B'; |