Skip to content

Instantly share code, notes, and snippets.

@903124
903124 / s1.py
Created February 6, 2025 16:58
# outlines/processor/structured.py
...
class GuideLogitsProcessor(OutlinesLogitsProcessor):
"""Bias generation using a finite
Attributes
----------
tokenizer
The tokenizer used to convert tokens to ids.
guide
import chess
import re
import outlines.text.generate as generate
import outlines.models as models
import chess.engine
import chessboard.display
import os
os.environ["TOKENIZERS_PARALLELISM"] = "false"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
query = '''
SELECT pitch_type,release_speed,release_pos_x,release_pos_z,pitcher,pfx_x,pfx_z,plate_x,plate_z,balls,strikes,
vx0,vy0,vz0,ax,ay,az,release_spin_rate,release_extension,description
FROM statcast_2018
WHERE release_speed >= 0
'''
import math
import matplotlib.pyplot as plt
#initial condition
mass = 5.125 #Oz
circumference = 9.125 #inches
x0 = 0 #ft
y0 = 2.000 #ft
z0 = 3 #ft
exit_speed = 100 #mph