This file contains hidden or 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
# train_grpo.py | |
import re | |
import torch | |
from datasets import load_dataset, Dataset | |
from transformers import AutoTokenizer, AutoModelForCausalLM | |
from peft import LoraConfig | |
from trl import GRPOConfig, GRPOTrainer | |
# Load and prep dataset |
This file contains hidden or 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
class UploadPage extends StatefulWidget { | |
UploadPage({Key key, this.url}) : super(key: key); | |
final String url; | |
@override | |
_UploadPageState createState() => _UploadPageState(); | |
} | |
class _UploadPageState extends State<UploadPage> { |
This file contains hidden or 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 sys | |
import firebase_admin | |
from firebase_admin import credentials | |
from firebase_admin import storage | |
cred = credentials.Certificate('/Users/your.name/yada-yada-firebase-adminsdk.json') | |
firebase_admin.initialize_app(cred, { | |
'storageBucket': '<yourstorage>.appspot.com' | |
}) |
This file contains hidden or 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 sys | |
import requests | |
import firebase_admin | |
from firebase_admin import credentials | |
from firebase_admin import storage | |
# The url is passed as an argument | |
image_url = sys.argv[1] | |
cred = credentials.Certificate('/Users/your.name/yada-yada-firebase-adminsdk.json') |
This file contains hidden or 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 pandas as pd | |
# The is an alternative | |
# from google.cloud import firestore | |
# db = firestore.Client() | |
# db = firestore.Client.from_service_account_json("/Users/your.name/yada-yada-firebase-adminsdk.json") | |
import firebase_admin | |
from firebase_admin import credentials | |
from firebase_admin import firestore |
This file contains hidden or 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 pandas as pd | |
# The is an alternative | |
# from google.cloud import firestore | |
# db = firestore.Client() | |
# db = firestore.Client.from_service_account_json("/Users/your.name/yada-yada-firebase-adminsdk.json") | |
import firebase_admin | |
from firebase_admin import credentials | |
from firebase_admin import firestore |