Skip to content

Instantly share code, notes, and snippets.

View exlaw's full-sized avatar
🏀

Aiwei Liu exlaw

🏀
View GitHub Profile
@cyysky
cyysky / 20251230_wedlm_openai_server.py
Last active January 13, 2026 08:03
tencent/WeDLM-8B-Instruct openai compatible server
from fastapi import FastAPI, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
from typing import List, Optional, Dict, Any
import uvicorn
import time
from transformers import AutoTokenizer
from wedlm import LLM, SamplingParams
app = FastAPI(title="WeDLM OpenAI Compatible API")
@kkweon
kkweon / policy_gradient.py
Created May 18, 2017 07:17
Keras Policy Gradient Example
"""
Simple policy gradient in Keras
"""
import gym
import numpy as np
from keras import layers
from keras.models import Model
from keras import backend as K