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
| 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") |
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
| """ | |
| 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 |